57 Views
avoid inheritance in java language
Answer (1)
Hello,
You cannot restrict inheritance in Java. But to prevent inheritance, use the keyword "final" when creating the class. The designers of the String class realized that it was not a candidate for inheritance and have prevented it from being extended.
Hope this helps
Thank You
Related Questions
final keyword in java language
19 Views
applets meaning in java language
52 Views
super keyword in java language
30 Views
Chandigarh University Admissi...
Apply
Ranked #1 Among all Private Indian Universities in QS Asia Rankings 2025 | Scholarships worth 210 CR
Amity University Noida B.Tech...
Apply
Among Top 30 National Universities for Engineering (NIRF 2024) | 30+ Specializations | AI Powered Learning & State-of-the-Art Facilities
Amity University, Noida Law A...
Apply
700+ Campus placements at top national and global law firms, corporates, and judiciaries
DES University B.Tech Admissi...
Apply
Last Date to Apply: 30th April'25. Ranked 10th among Emerging Engineering Institutes in India by Times
UPES Integrated LLB Admission...
Apply
Ranked #28 amongst Institutions in India by NIRF | Ranked #1 in India for Academic Reputation by QS Rankings | 16.6 LPA Highest CTC | Last Date Ex...
Trending Articles/News
VITEEE 2025 Result Date Released by VIT - Direct Link Here
35 minutes ago
IISER Preparation Tips 2025 - How to Crack IAT
51 minutes ago
IISER IAT Books for Physics, Chemistry, Mathematics, Biology
52 minutes ago