eclipse - Easiest way to call one same method in two different class junit -


i have got 1 method login in "first class". in "second class" again login needed done, can tell me what's easiest way task ?

  1. should create object of first class in second class , call methods of first class.
  2. should create base class , extend ?

please provide example if possible thanks

alright let me answer here:

class mybase {     void login()     {         // todo base defined login here     } }  class firstclass extends mybase {     // define methods in order fine      void login()     {         // todo firstclass defined login here     }      void addtest()     {         // addtest code here     } }  int main() {     mybase base;     firstclass firstclass;      base.login() // call mybase method login     firstclass.login() // call firstclass method login } 

so order of defining methods isn't important long doing them nicely. if possible read inheritance in java more clear approach.

do understand now..? if yes start coding , if not let me know , we'll go more deeper...


Comments

Popular posts from this blog

basic authentication with http post params android -

vb.net - Virtual Keyboard commands -

css - Firefox for ubuntu renders wrong colors -