aspose file tools*
The moose likes Beginning Java and the fly likes Extending a class Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "Extending a class " Watch "Extending a class " New topic
Author

Extending a class

jose chiramal
Ranch Hand

Joined: Feb 12, 2010
Posts: 266
How many ways can we extend a class ?

Can i say that we can extend a class in two ways :
1. using extends
2. using anonymous inner class
Devaka Cooray
ExamLab Creator
Saloon Keeper

Joined: Jul 29, 2008
Posts: 3164
    
  47

You can extend an exception class as the same way as you extend any other class.
An anonymous inner class implicitly extends another class - so it can be used.


Author of ExamLab ExamLab - a free SCJP / OCPJP exam simulator
What would SCJP exam questions look like? -- Home -- Twitter -- How to Ask a Question
Lalit Mehra
Ranch Hand

Joined: Jun 08, 2010
Posts: 384

@ jose

yes ofcourse you can extend a class using extends ...

anonymous innner classes serve as an implicit datatype for the class they are constructed in ... having access to all its (data/method) members.


http://plainoldjavaobject.blogspot.in
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Extending a class