This week's book giveaway is in the OCAJP 8 forum.
We're giving away four copies of OCA Java SE 8 Programmer I Study Guide and have Edward Finegan & Robert Liguori on-line!
See this thread for details.
The moose likes Beginning Java and the fly likes Class inheritance. Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of OCA Java SE 8 Programmer I Study Guide this week in the OCAJP 8 forum!
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "Class inheritance." Watch "Class inheritance." New topic

Class inheritance.

Sunali Anu

Joined: Jun 04, 2007
Posts: 14
Want to know from which class a String Class is inherited.
marc weber

Joined: Aug 31, 2004
Posts: 11343

If you check the API documentation for String, you will see that String inherits directly from Object...

If there are direct known subclasses, these are also listed in the API. None are shown for String.

"We're kind of on the level of crossword puzzle writers... And no one ever goes to them and gives them an award." ~Joe Strummer
Jesper de Jong
Java Cowboy
Saloon Keeper

Joined: Aug 16, 2005
Posts: 15002

The API documentation also mentiones that class String is final, which means that it cannot be subclassed - so there are no classes that extend String.

Java Beginners FAQ - JavaRanch SCJP FAQ - The Java Tutorial - Java SE 8 API documentation
I agree. Here's the link:
subject: Class inheritance.
It's not a secret anymore!