This week's book giveaway is in the Go forum.
We're giving away four copies of Head First Go and have Jay McGavren on-line!
See this thread for details.
Win a copy of Head First Go this week in the Go forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Liutauras Vilda
  • Bear Bibeault
  • Paul Clapham
  • Jeanne Boyarsky
Sheriffs:
  • Devaka Cooray
  • Junilu Lacar
  • Tim Cooke
Saloon Keepers:
  • Tim Moores
  • Ron McLeod
  • Tim Holloway
  • Claude Moore
  • Stephan van Hulst
Bartenders:
  • Winston Gutkowski
  • Carey Brown
  • Frits Walraven

How every class by default extends from object class  RSS feed

 
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Can someone has the POC for this?
 
Greenhorn
Posts: 26
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
All classes extend form Object, either implicitly or explicitly, directly or indirectly, the whole class hierarchy in Java ends up pointing at Object which is at the root.
 
Ranch Hand
Posts: 90
Java Netbeans IDE
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Welcome to the ranch!

Proof of Concept? Yes we have it.

But would you tell us how you would approach it ?
 
Fred Masen
Greenhorn
Posts: 26
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Mano is this reply for me ?
 
Mano Ag
Ranch Hand
Posts: 90
Java Netbeans IDE
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Hi All,

My answer was for the #OP
 
Saloon Keeper
Posts: 20511
115
Android Eclipse IDE Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
People Of Color?

Price of Cheese?
 
Fred Masen
Greenhorn
Posts: 26
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Proof of Concept ? ;
It's a transitive inheritance relationship, and it occurs in only one direction: at no point in the hierarchy it will be possible that a single class extends from more than one class
 
Bartender
Posts: 2166
92
Eclipse IDE Google Web Toolkit Java
  • Likes 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have some proof


 
Fred Masen
Greenhorn
Posts: 26
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
public class MyClass extends Object {

Is exactly the same as this:

public class MyClass {

And if we have this:

public class MySubClass extends MyClass {

Then MySubClass extends from MyClass which extends from Object
 
Marshal
Posts: 63485
207
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Look in the Java® Language Specification (=JLS), where it tells you,

The class Object is a superclass (§8.1.4) of all other classes.

 
Tim Holloway
Saloon Keeper
Posts: 20511
115
Android Eclipse IDE Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Please don't go throwing around abbreviations and acronyms carelessly. Not everyone here is fluent in English, and even those who are native speakers don't necessarily know what you're talking about if you abbreviate it.

A Class is a fundamental concept in Java. Every class has certain common properties. Some of them are very visible, others are invisible and often just part of the internal secret workings of how Java handles classes.

By making every class (including class java.lang.Class) be subclassed from a common base class (java.lang.Object), we can acknowledge and exploit those commonalities.

And java.lang.Object is an instance of java.lang.Class, which can be used to introspect that class. If that seems kind of circular, it is. But it works best that way.
 
Willie Smits increased rainfall 25% in three years by planting trees. Tiny ad:
Become a Java guru with IntelliJ IDEA
https://www.jetbrains.com/idea/
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!