Object is the super type of all classes in Java. Consider my following class
public class Test {
public static void main1(Object[] args) {
System.out.println("I accept an object array");
}
public static void main(String[] args) {
main1(args);
}
}
Due to object superiority object array can accept any object type arrays. But Still java doesn't consider following class contains a main method.
public class Test {
public static void main(Object[] args) {
}
}
Why java never give this opportunity while object is ultimate supper type for all classes in java.
Objectarray can accept any object type String, Integer. so it doesn't matter