Win a copy of Kotlin in Action this week in the Kotlin forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

abstract class  RSS feed

 
rabby gail
Greenhorn
Posts: 12
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
can abstract class be subclassed?

explain with example

Thanks
 
Ernest Friedman-Hill
author and iconoclast
Sheriff
Posts: 24217
38
Chrome Eclipse IDE Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Yes, it can, absolutely. That's generally the whole point of an abstract class.

As for an example: why don't you reply and show an example, and we'll tell you if it's correct? I bet you can do it!
 
Adam Nace
Ranch Hand
Posts: 117
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Here's a good article that explains the concept of abstract classes.

For examples, see the code examples for just about ANY design pattern discussed in wikipedia: Design Patterns.

Particularly, the Creational Patterns Abstract Factory and Builder.

- Adam
 
Stan James
(instanceof Sidekick)
Ranch Hand
Posts: 8791
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Open up the JavaDoc and look for the word "Abstract" in the class names. Hey, it's at the top! Open one up and look for subclasses. These are some solid examples of how Sun did just what you're looking for.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!