• 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
public class Test { }What is the prototype of the default constructor?

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

ANSWER DOWNLOAD EXAMIANS APP

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

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

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

0
Compile time error
None of these
2.0

ANSWER DOWNLOAD EXAMIANS APP

JAVA Constructors and Methods
What will be the return type of a method that not returns any value?

void
double
None of these
int

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();
A a = new A(String s);
All of these
A a = new B(5);
None of these

ANSWER DOWNLOAD EXAMIANS APP

JAVA Constructors and Methods
In which area of memory, the system stores parameters and local variables whenever a method is invoked?

Heap
Stack
Array
Storage Area

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
↑