How do you call a method from another 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.

Sizin İçin Seçtik  Can I use udemy courses?

Leave a Reply

Your email address will not be published. Required fields are marked *