Home » JAVA Programming » Methods » Question
  1. Which of these statement is incorrect?
    1. All object of a class are allotted memory for the all the variables defined in the class
    2. All object of a class are allotted memory for the methods defined in the class
    3. If a function is defined public it can be accessed by object of other class by inheritation
    4. main() method must be made public
    5. None of these
Correct Option: B

All object of class share a single copy of methods defined in a class, Methods are allotted memory only once. All the objects of the class have access to methods of that class are allotted memory only for the variables not for the methods.



Your comments will be displayed only after manual approval.