Implementing login functionality using core java concepts