• Post Reply Bookmark Topic Watch Topic
  • New Topic

determining which child classes are extending a certain parent class in an application  RSS feed

 
Sachidananda Pattnaik
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi All,

I have an application with many packages with various classes. How I can find which are the child classes in my entire application which extends a perticular class.

e.g I have my base class say 'Example.java'
How I can find which are the child classes which extends the base class 'Example'

is there any command to find out ??

Thanks
Sachin
 
Campbell Ritchie
Marshal
Posts: 56578
172
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
They are called superclass and subclass, and one of the ideas behind object-oriented programming is that you don't need to know which subclasses there are. You simply use them.
 
Wouter Oet
Bartender
Posts: 2700
IntelliJ IDE Opera
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Why do you want to know that information? What are you going to do with it?
 
Sachidananda Pattnaik
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks for some prompt replies.
I do understand that the benifits of OOP is to reuse with extending the superclass and work on your own subclass.
This is a just a question came up from a casual discussion with my friends.
Now I just want to know if by any means can we found out what are the subclasses which are extending a certain superclass.
Is there any command or process by which I can find all the subcalss reference.

for e.g
>>I have a base class XYZ.java and many subclass are extending this class.
>>Now if I delete this class then on recompiling it will throw errors on those class which are extending it.
>>The challenge here is I have to find out the impact of the class in the entire application before deleting the XYZ.java.


 
Wouter Oet
Bartender
Posts: 2700
IntelliJ IDE Opera
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Most ide's provide that functionality and you can also view it in the javadoc's.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!