• HOME
  • QUIZ
  • CONTACT US
EXAMIANS
  • COMPUTER
  • CURRENT AFFAIRS
  • ENGINEERING
    • Chemical Engineering
    • Civil Engineering
    • Computer Engineering
    • Electrical Engineering
    • Mechanical Engineering
  • ENGLISH GRAMMAR
  • GK
  • GUJARATI MCQ

JAVA CONSTRUCTORS AND METHODS

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( ) ) ) ; }}

1.0
0.5
0.0
10.0

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 ) ; } }

None of these
0
2.0
Compile time error

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);}}

Method 2
Method 1
Compile time error as final method can't be overloaded
None of these

ANSWER DOWNLOAD EXAMIANS APP

JAVA Constructors and Methods
What is the output of the program?class Test{ public int display(int x, int y){ return ("The sum of x and y is " + x + y); } public static void main(String args[]){ Test test = new Test(); System.out.println(test.display(4,5)); } }

The sum of x and y is 9
does not compile
None of these
The sum of x and y is 45

ANSWER DOWNLOAD EXAMIANS APP

JAVA Constructors and Methods
The implicit return type of a constructor is

A class object in which it is defined.
None of these
void
There is no return type.

ANSWER DOWNLOAD EXAMIANS APP
  • «
  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • »

GO TO PAGE

DOWNLOAD APP

  • APPLE
    from app store
  • ANDROID
    from play store

SEARCH

LOGIN HERE


  • GOOGLE

FIND US

  • 1.70K
    FOLLOW US
  • EXAMIANSSTUDY FOR YOUR DREAMS.
  • SUPPORT :SUPPORT EMAIL ACCOUNT : examians@yahoo.com

OTHER WEBSITES

  • GUJARATI MCQ
  • ACCOUNTIANS

QUICK LINKS

  • HOME
  • QUIZ
  • PRIVACY POLICY
  • DISCLAIMER
  • TERMS & CONDITIONS
  • CONTACT US
↑