JAVA Constructors and Methods In which area of memory, the system stores parameters and local variables whenever a method is invoked? Storage Area Array Heap Stack Storage Area Array Heap Stack 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 Won't compile because of line (1); constructor can't be private 10 50 50 Won't compile because of line (5); constructor can't be final Won't compile because of line (1); constructor can't be private 10 50 50 ANSWER DOWNLOAD EXAMIANS APP
JAVA Constructors and Methods public class Test { }What is the prototype of the default constructor? Test(void) Test( ) public Test(void) public Test( ) None of these Test(void) Test( ) public Test(void) public Test( ) None of these ANSWER DOWNLOAD EXAMIANS APP
JAVA Constructors and Methods What will be the result of compiling and running the given code?class A{ int b=10; private A(){ this.b=7; } int f(){ return b; }}class B extends A{ int b;}public class Test{ public static void main(String[] args){ A a = new B(); System.out.println(a.f()); }} Compilation Fails None of these Prints 0 Prints 10 Prints 7 Compilation Fails None of these Prints 0 Prints 10 Prints 7 ANSWER DOWNLOAD EXAMIANS APP
JAVA Constructors and Methods class A{ A(String s){} A(){}}1. class B extends A{2. B(){}3. B(String s){4. super(s);5. }6. void test(){7. // insert code here8. }9. }Which of the below code can be insert at line 7 to make clean compilation ? A a = new B(5); None of these All of these A a = new B(); A a = new A(String s); A a = new B(5); None of these All of these A a = new B(); A a = new A(String s); ANSWER DOWNLOAD EXAMIANS APP
JAVA Constructors and Methods Determine output of the following program.public class Test{ public static void main(String args[]){ System.out.println( Math.floor( Math.random( ) ) ) ; }} 0.0 0.5 10.0 1.0 0.0 0.5 10.0 1.0 ANSWER DOWNLOAD EXAMIANS APP