7. Which of the following statements is
correct?
a) Public method is accessible to all
other classes in the hierarchy
b) Public method is accessible only to
subclasses of its parent class
c) Public method can only be called by
object of its
class
d) Public method can be accessed by
calling object of the public class
Answers
Answered by
5
Answer:
a) Public method is accessible to all
other classes in the hierarchy.
It is the correct option.
Answered by
0
Public method is accessible to all other classes in the hierarchy (Option A).
- Public method: These are those type of methods which are accessible from inside as well as from outside of the class.
- Private method: These are those type of methods which can be accessed only from inside of the class and its child class.
- Protected method: These are those type of methods which can be accessed from inside the class and from other classes also within the same package.
Similar questions
English,
4 months ago
Math,
8 months ago
CBSE BOARD X,
8 months ago
Chemistry,
1 year ago
Math,
1 year ago