JAVA Constructors and Methods Which of the modifier can't be used for constructors? static protected public private static protected public private ANSWER DOWNLOAD EXAMIANS APP
JAVA Constructors and Methods class MyClass{ MyClass(){ System.out.print("one"); } public void myMethod(){ this(); System.out.print("two"); }} public class TestClass{ public static void main(String args[]){ MyClass obj = new MyClass(); obj.myMethod(); }} two one one None of these Compilation Error one one two one Exception two one one None of these Compilation Error one one two one Exception 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 ? None of these A a = new B(5); A a = new B(); All of these A a = new A(String s); None of these A a = new B(5); A a = new B(); All of these 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.5 0.0 10.0 1.0 0.5 0.0 10.0 1.0 ANSWER DOWNLOAD EXAMIANS APP
JAVA Constructors and Methods What is Math.floor(3.6)? 3.0 4.0 3 4 3.0 4.0 3 4 ANSWER DOWNLOAD EXAMIANS APP
JAVA Constructors and Methods 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 examians() throws IOException{} void examians() throw IOException{} void examians(void) throws IOException{} void examians() throws IOException{} void examians() {} throws IOException examians() throws IOException{} void examians() throw IOException{} void examians(void) throws IOException{} void examians() throws IOException{} ANSWER DOWNLOAD EXAMIANS APP