Single Choice Not Set

QDetermine Output:
class A{
	public static void method(int i){
		System.out.print("Method 1");
	}

	public static int method(String str){
		System.out.print("Method 2");
		return 0;
	}
}

public class Test{
     
	public static void main(String args[]){
		A.method(5);
	}
}

ID: #2177 Java Constructor and Methods 954 views
Question Info
#2177Q ID
Not SetDifficulty
Java Constructor and MethodsTopic

Choose the Best Option

Click any option to instantly check if you're correct.

  • A Method 1 ✔ ✖
  • B Method 2 ✔ ✖
  • C Compile time error as final method can't be overloaded ✔ ✖
  • D None of the above ✔ ✖
Correct Answer

Explanation

Method 1

Share This Question

Challenge a friend or share with your study group.