Question:
What does the ‘final’ keyword mean when applied to a class in Java?
जावा में जब किसी क्लास पर ‘final’ कीवर्ड लगाया जाता है, तो इसका क्या अर्थ होता है?
Options:
- The class cannot be extended (subclassed)
- The class cannot be instantiated
- All methods inside the class become static
- The class must be abstract
- क्लास को इनहेरिट (विस्तारित) नहीं किया जा सकता
- क्लास का ऑब्जेक्ट नहीं बनाया जा सकता
- सभी विधियाँ स्थैतिक हो जाती हैं
- क्लास को अमूर्त (abstract) होना चाहिए
Correct Answer: a)
Explanation:
A `final` class in Java cannot be inherited/subclassed by any other class (e.g. `java.lang.String` is a final class for security and immutability) (Option a).
जावा में final क्लास को किसी अन्य क्लास द्वारा इनहेरिट नहीं किया जा सकता (विकल्प a)।