Win a copy of Functional Reactive Programming this week in the Other Languages forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Extending a class

 
jose chiramal
Ranch Hand
Posts: 266
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Marshal
Pie
Posts: 4682
333
Chrome Eclipse IDE Google App Engine IntelliJ IDE jQuery Postgres Database Tomcat Server
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
Lalit Mehra
Ranch Hand
Posts: 384
Eclipse IDE Firefox Browser Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
@ 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.

 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic