If a class is declared as ________, it cannot be extended.
- abstract
- final
- private
- static
In Java, if a class is declared as final, it cannot be extended or subclassed. This is often used to prevent further modification or inheritance of a class, providing a level of immutability.
Loading...
Related Quiz
- Which of the following statements correctly creates an object of a class named 'Dog'?
- Which index of a multi-dimensional array represents the row index in Java?
- How can you access variables in the surrounding scope from a lambda expression?
- What does the getConnection method of DriverManager class do?
- What is the purpose of using URL Encoding in Java?