Computer Science, asked by zckansari9370, 1 year ago

When you extend a class, the subclass inherits all of the ........ methods from the parent class.
A.Public
B.private
C.protected
D.both A and C

Answers

Answered by Anonymous
0
______✨ HEY MATE ✨______

➡️Option (D) is the right answer ✔️

<marquee>✌️ I THINK IT HELPED YOU ✌️
Answered by qwnerazzuri
0

Both A and C (Option D).

when we extend a parent class, the subclass inherits all of the public as well as the private method of the parent class.

  • protected methods: These are those methods which are used when we don't want the child classes to inherit this method.
  • Public method: These are those methods which are used when want the subclasses to inherit or use this method.
  • Private method: These are those methods which are used when we don't want the outside classes member to access this method, it is only to inherit to subclasses only.
Similar questions