Home / MCQ Bank / Computer
Computer Constructors And Methods

What is the output for the below code? public class A{ int add(int i, int j){ return i+j; } } public class B extends A{ public static void main(String argv[]){ short s = 9; System.out.println(add(s,6)); } }

Select the best option to verify your answer:
Show Correct Answer
Correct Answer: Option B • Compile fail due to error on line no 9

Related Computer Questions

What is the purpose of creating a data frame? Which header file is used for reading and writing to a file? A/An ______ contains programs that can be selected. What is the purpose of the Java Collections Framework? Which method in Ruby is used to set the position of the file pointer?