Which keyword is used in Java to inherit a class?
2024
Which keyword is used in Java to inherit a class?
- A.
inherits
- B.
extends
- C.
implements
- D.
super
- E.
Question not attempted
Attempted by 125 students.
Show answer & explanation
Correct answer: B
In Java, the extends keyword is used when a class inherits from another class.