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 output of the following program? #include<stdio.h> int fibo(int n) { if(n<=1) return n; return fibo(n-1) + fibo(n-2); } int main() { int r = fibo(50000); printf("%d",r); return 0; } The data members and functions of a class in C++ are by default ______ Which statistical test is commonly used to assess the presence of seasonality in time series data? hiveconf variables are set as normal by using the following statement? What is the purpose of the loop keyword in Ruby?