My main class is called Driver and my subclasses are Individual, NGO, POrganisation and Government. These 4 subclasses are under the customer class and the only thing that differentiate them are rates and customertype. Different subclasses have different amount of rates ( NGO rate= 10%, Gov rate=15% etc) The 4 subclasses are inherits from customer class. So, can anyone help me by giving a sample on how to call the subclasses from the Driver class?
1 Replies - 491 Views - Last Post: 24 May 2011 - 06:39 AM
#1
Based on Java, How to call a subclasses from the driver class?
Posted 24 May 2011 - 06:29 AM
Replies To: Based on Java, How to call a subclasses from the driver class?
#2
Re: Based on Java, How to call a subclasses from the driver class?
Posted 24 May 2011 - 06:39 AM
Really vague and philosophical question.
All OO languages are based on inheritage. What is exactly your question ?
Classes Car, Bus, Tramway, Train can inherit from Vehicule. So you can make
Vehicule x = new Bus(....);
Vehicule y = new TramWay(...);
You will have to tell us more of what you are trying to do
All OO languages are based on inheritage. What is exactly your question ?
Classes Car, Bus, Tramway, Train can inherit from Vehicule. So you can make
Vehicule x = new Bus(....);
Vehicule y = new TramWay(...);
You will have to tell us more of what you are trying to do
Page 1 of 1
|
|

New Topic/Question
Reply




MultiQuote



|