Given:
What is the result?
A. int main 1
B. Object main 1
C. String main 1
D. Compilation fails
E. An exception is thrown at runtime
Given:
What is the result?
A. int main 1
B. Object main 1
C. String main 1
D. Compilation fails
E. An exception is thrown at runtime
public static void main(int[] args) {
System.out.println(“int main”+args[0]);
}
public static void main(Object[] args) {
System.out.println(“Object main”+args[0]);
}
public static void main(String[] args) {
System.out.println(“String main”+args[0]);
}
}
result
String main1
Answer C:
Other main methods are overloaded, but they would never act as the starting point of the app.
C