Discussion Forum : Introduction To Methods And Streams
Question -

Which of these statement is incorrect?

Options:
A .  All object of a class are allotted memory for the all the variables defined in the class.
B .  If a function is defined public it can be accessed by object of other class by inheritation.
C .  main() method must be made public.
D .  All object of a class are allotted memory for the methods defined in the class.
Answer: Option D

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.



Was this answer helpful ?
Next Question
Submit Your Solution hear:

Your email address will not be published. Required fields are marked *