57 Views

avoid inheritance in java language


Grag 12th Sep, 2021
Answer (1)
Vishesh Singh 12th Sep, 2021

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

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 MBA Ad...
Apply
Amongst top 3% universities globally (QS Rankings)
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...
View All Application Forms

Download the Careers360 App on your Android phone

Regular exam updates, QnA, Predictors, College Applications & E-books now on your Mobile

150M+ Students
30,000+ Colleges
500+ Exams
1500+ E-books