JAVA Constructors and Methods In which area of memory, the system stores parameters and local variables whenever a method is invoked? Array Storage Area Stack Heap Array Storage Area Stack Heap ANSWER DOWNLOAD EXAMIANS APP
JAVA Constructors and Methods What is the output for the below code?public class Test{ public static void printValue(int i, int j, int k){ System.out.println("int"); } public static void printValue(byte...b){ System.out.println("long"); } public static void main(String... args){ byte b = 9; printValue(b,b,b); }} None of these Compilation fails Compilation clean but throws RuntimeException int long None of these Compilation fails Compilation clean but throws RuntimeException int long ANSWER DOWNLOAD EXAMIANS APP
JAVA Constructors and Methods Determine Output:class A{public static void method(int i){System.out.print("Method 1");}public static int method(String str){System.out.print("Method 2");return 0;}}public class Test{ public static void main(String args[]){A.method(5);}} None of these Method 1 Method 2 Compile time error as final method can't be overloaded None of these Method 1 Method 2 Compile time error as final method can't be overloaded ANSWER DOWNLOAD EXAMIANS APP
JAVA Constructors and Methods What is the expected output?public class Profile {private Profile(int w) { // line 1System.out.print(w);}public final Profile() { // line 5System.out.print(10);}public static void main(String args[]) {Profile obj = new Profile(50);}} Won't compile because of line (5); constructor can't be final 10 50 50 Won't compile because of line (1); constructor can't be private Won't compile because of line (5); constructor can't be final 10 50 50 Won't compile because of line (1); constructor can't be private ANSWER DOWNLOAD EXAMIANS APP
JAVA Constructors and Methods public class Test { }What is the prototype of the default constructor? None of these public Test( ) Test(void) Test( ) public Test(void) None of these public Test( ) Test(void) Test( ) public Test(void) ANSWER DOWNLOAD EXAMIANS APP
JAVA Constructors and Methods 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 ) ; } } Compile time error 0 None of these 2.0 Compile time error 0 None of these 2.0 ANSWER DOWNLOAD EXAMIANS APP