To class a method of another class, we need to have the object of that class . Here, we have a class Student that has a method getName() . We access this method from the second class SimpleTesting by using the object of the Student class.
To class a method of another class, we need to have the object of that class . Here, we have a class Student that has a method getName() . We access this method from the second class SimpleTesting by using the object of the Student class.