MCQ Single Best Answer Not Set

QWhat will be the result after compiling this code?
class SuperClass{
      public int doIt(String str, Integer... data)throws Exception{
            String signature = "(String, Integer[])";
            System.out.println(str + " " + signature);
            return 1;
      }
}

public class Test extends SuperClass{
      public int doIt(String str, Integer... data){
            String signature = "(String, Integer[])";
            System.out.println("Overridden: " + str + " " +signature);
            return 0;
      }

      public static void main(String... args){
            SuperClass sb = new Test();
            sb.doIt("hello", 3);
      }
}

ID: #2328 Java Exception MCQ 935 views
Question Info
#2328Q ID
Not SetDifficulty
Java Exception MCQTopic

Choose the Best Option

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

  • A Overridden: hello (String, Integer[])
  • B hello (String, Integer[])
  • C Compilation fails
  • D None of these
Correct Answer: Option C

Explanation

Compilation fails

Share This Question

Challenge a friend or share with your study group.