The finalize() method is called just prior to None of these A variable goes out of scope. An object, variable or method goes out of scope. An object or variable goes out of scope. Before garbage collection. TRUE ANSWER : ? YOUR ANSWER : ?
What is the output for the below code ?class A{ public A(){ System.out.println("A"); } public A(int i){ this(); System.out.println(i); }}class B extends A{ public B(){ System.out.println("B"); } public B(int i){ this(); System.out.println(i+3); }}public class Test{ public static void main (String[] args){ new B(5); }} A 5 B 8 None of these B 8 A 5 A B 8 A B 5 TRUE ANSWER : ? YOUR ANSWER : ?
Which of these is a legal definition of a method named examveda assuming it throws IOException, and returns void. Also assume that the method does not take any arguments. Select the one correct answer. void examians() {} throws IOException void examians() throws IOException{} void examians(void) throws IOException{} void examians() throw IOException{} examians() throws IOException{} TRUE ANSWER : ? YOUR ANSWER : ?
public class Test { }What is the prototype of the default constructor? public Test( ) None of these public Test(void) Test(void) Test( ) TRUE ANSWER : ? YOUR ANSWER : ?
In which area of memory, the system stores parameters and local variables whenever a method is invoked? Array Heap Stack Storage Area TRUE ANSWER : ? YOUR ANSWER : ?
What is the output of the above program ?class Num { Num(double x ){ System.out.println( x ) ; } }public class Test extends Num { public static void main(String[] args){ Num num = new Num( 2 ) ; } } 2.0 0 Compile time error None of these TRUE ANSWER : ? YOUR ANSWER : ?
What is the expected output?class Animal {Animal() {System.out.println("Animal");}}class Wild extends Animal{Wild() {System.out.println("Wild");super();}}public class Test {public static void main(String args[]) {Wild wild = new Wild();}} Runtime Exception Compilation Error Wild Animal Animal Wild TRUE ANSWER : ? YOUR ANSWER : ?
What will be the return type of a method that not returns any value? int None of these double void TRUE ANSWER : ? YOUR ANSWER : ?
The main method should be static for the reason None of these It can be executed without creating any instance of the class. It can be accessed by every method or variable without any hindrance. It can be accessed easily by the class loader. TRUE ANSWER : ? YOUR ANSWER : ?