• 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
What is Math.floor(3.6)?

4.0
3.0
4
3

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 2
Method 1
Compile time error as final method can't be overloaded

ANSWER DOWNLOAD EXAMIANS APP

JAVA Constructors and Methods
public class MyClass{ }For the above class(MyClass) what is the correct way of declaring constructor?

MyClass(void) {}
MyClass(){}
1 and 3
public MyClass(){}
public MyClass(void){}

ANSWER DOWNLOAD EXAMIANS APP

JAVA Constructors and Methods
public class Test { }What is the prototype of the default constructor?

public Test(void)
Test(void)
Test( )
None of these
public Test( )

ANSWER DOWNLOAD EXAMIANS APP

JAVA Constructors and Methods
The finalize() method is called just prior to

An object or variable goes out of scope.
An object, variable or method goes out of scope.
Before garbage collection.
None of these
A variable goes out of scope.

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
2.0
None of these
0

ANSWER DOWNLOAD EXAMIANS APP
MORE MCQ ON JAVA Constructors and Methods

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
↑