• Post Reply Bookmark Topic Watch Topic
  • New Topic

inheritance:  RSS feed

 
Greenhorn
Posts: 19
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
when i compile java file which contain class it will inherits all the methods from object class. when this happened.


is there any way achieve a class becomes superclass to all the class in applications without extending it at the time of designing. it will happened at compile time or runtime
 
Bartender
Posts: 4002
42
Chrome Fedora Hibernate
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
ranjithkumar.gendhe kumar wrote:when i compile java file which contain class it will inherits all the methods from object class. when this happened.

What ever class you write will inherit from class Object if it doesn't explicitly extends one.
is there any way achieve a class becomes superclass to all the class in applications without extending it at the time of designing...

No. I guess by "design time" you meant "compile time"?

 
ranjithkumar.gendhe kumar
Greenhorn
Posts: 19
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
i have one application


in that i have a class like this

class superObj{

//fields
//mehods


}

class map{

//fields
//mehods
}

after compiling this class map it will be subclass of map without extending it.

or

at the runtime.


is it possible
 
Saloon Keeper
Posts: 7993
143
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Like Vijitha said, No.

Why would you want to do this anyway?
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!