Computer Science, asked by Anonymous, 4 months ago

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 deepakkumar9254
5

Answer:

a) Public method is accessible to all

other classes in the hierarchy.

It is the correct option.

Answered by qwnerazzuri
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