A friendly place for programming greenhorns!
Big Moose Saloon
Register / Login
Extending a class
Joined: Feb 12, 2010
Jun 09, 2010 08:29:16
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
Joined: Jul 29, 2008
Jun 09, 2010 09:25:40
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
- a free SCJP / OCPJP exam simulator
What would SCJP exam questions look like?
How to Ask a Question
Joined: Jun 08, 2010
Jun 10, 2010 01:42:37
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.
It is sorta covered in the
JavaRanch Style Guide
subject: Extending a class
Question from K&B Chapter 5
Aggregation And Inheritence
Doubt in TagSupport (Classic Tag)
All times are in JavaRanch time: GMT-6 in summer, GMT-7 in winter
| Powered by
Copyright © 1998-2014