Home / MCQ Bank / Computer
Computer Inheritence

What 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); } }

Select the best option to verify your answer:
Show Correct Answer
Correct Answer: Option C • Compilation fails

Related Computer Questions

Comments put in cells are called Which keyword is used to define generic methods in Java? What id the syntax for catching any type of exceptions? What is the purpose of the 'typedef' keyword in C++ structures? An international standard, multilevel set of protocols to promote compatibility among telecommunications networks. Select the best fit for answer: