+ 4
public class Program { public static class Test { private String function() { return ("Man United"); } public final static String function (int data) { return ("Man City"); } } //end of Test class public static void main (String[]args) { Test obj= new Test(); System.out.println (obj.function ()); } }
30th Jan 2022, 8:12 AM
Bahha┣
Bahha┣ - avatar
+ 4
you didn't define any class named Test and you are creating object from it. Test obj = new Test() ;
30th Jan 2022, 8:05 AM
Bahha┣
Bahha┣ - avatar
+ 1
try to define the object named test first before using an object of the same
31st Jan 2022, 6:06 PM
_Doph Bone_
_Doph Bone_ - avatar