• 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
  • Tim Cooke
  • Junilu Lacar
Sheriffs:
  • Paul Clapham
  • Devaka Cooray
  • Knute Snortum
Saloon Keepers:
  • Ron McLeod
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • Frits Walraven
Bartenders:
  • Carey Brown
  • salvin francis
  • Claude Moore

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?
 
Ranch Hand
Posts: 36
  • 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: 91
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
Ranch Hand
Posts: 36
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Mano is this reply for me ?
 
Mano Ag
Ranch Hand
Posts: 91
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: 20635
122
Android Eclipse IDE Java Linux Redhat Tomcat Server
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
People Of Color?

Price of Cheese?
 
Fred Masen
Ranch Hand
Posts: 36
  • 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: 2212
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
Ranch Hand
Posts: 36
  • 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: 64088
215
  • 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: 20635
122
Android Eclipse IDE Java Linux Redhat Tomcat Server
  • 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.
 
His brain is the size of a cherry pit! About the size of this ad:
Create Edit Print & Convert PDF Using Free API with Java
https://coderanch.com/wiki/703735/Create-Convert-PDF-Free-Spire
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!