• 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
Which of the modifier can't be used for constructors?

protected
static
private
public

ANSWER DOWNLOAD EXAMIANS APP

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

double
int
void
None of these

ANSWER DOWNLOAD EXAMIANS APP

JAVA Constructors and Methods
Given the following piece of code:class Person{ public int number;}public class Test{ public void doIt(int i , Person p){ i = 5; p.number = 8; } public static void main(String args[]){ int x = 0; Person p = new Person(); new Test().doIt(x, p); System.out.println(x + " " + p.number); }}What is the result?

0 8
5 8
5 0
0 0

ANSWER DOWNLOAD EXAMIANS APP

JAVA Constructors and Methods
The main method should be static for the reason

None of these
It can be executed without creating any instance of the class.
It can be accessed easily by the class loader.
It can be accessed by every method or variable without any hindrance.

ANSWER DOWNLOAD EXAMIANS APP

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

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

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?

Storage Area
Array
Stack
Heap

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
↑