This week's book giveaway is in the Mac OS forum.
We're giving away four copies of a choice of "Take Control of Upgrading to Yosemite" or "Take Control of Automating Your Mac" and have Joe Kissell on-line!
See this thread for details.
The moose likes Beginning Java and the fly likes Inheritance with two Children? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

JavaRanch » Java Forums » Java » Beginning Java
Bookmark "Inheritance with two Children?" Watch "Inheritance with two Children?" New topic

Inheritance with two Children?

Rik Ny

Joined: Oct 13, 2001
Posts: 13
If I have an abstract class with two children, then how do I create an object of each of the children from the driver??
Marilyn de Queiroz

Joined: Jul 22, 2000
Posts: 9046
Child1 child1 = new Child1();
Child2 child2 = new Child2();
Abstract child1 = new Child1();
Abstract child2 = new Child2();

"Yesterday is history, tomorrow is a mystery, and today is a gift; that's why they call it the present." Eleanor Roosevelt
Don't get me started about those stupid light bulbs.
subject: Inheritance with two Children?