thank you this si ssolved
Printable View
thank you this si ssolved
To execute/call a method in a class you need a reference to the class followed by a . followed by the method name. Like this: out.println("hi");Quote:
what code could be inserted in public static void main of Part2 so the printHI methd wil run.
Here the object reference is out and the method is println().
There is a different way to do it when the method is static. Then you use the class name vs using a reference to the object. Like this: System.out
Here System is a class and out is a static variable in that class.