Which of these statement is incorrect?
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:A
Which of these statement is incorrect?
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.
Explanation: 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.