@Thanks the_coder As he explained ; I have add some lines to my PageObject class. And then use them on the same class. Then call the login method from my test by creating an object reference.
But i was getting the following error.
Which was resolved by adding the following constructor to the Page object class