Inheritance question?

Ads
 

Inheritance question?

Q3)Create a class hierarchy as Company extended by AccountsDepartment. AccountsDepartment extended by AccountsReceivable and AccountsPayables. The Company performs following operations. (1) There is an inflow and outflow of cash by the customers. (2) Whenever a customer comes the AccountsDepartment ask for the customer details like customer id, name, email address, phone number and amount to be drawn or deposited. (3) If it is a deposit it is considered as AccountsReceivable. (4) If it is a withdraw it is considered as AccountsPayable.

please send the code of this question soon....plzzzzzzzz View Answers

there should be Bean Class as a Customer

View Answers

June 16, 2011 at 1:25 PM

class Company
{
...
..
}


class AccountDepartment extends Company
<br/>
{
<br/>
if(withdraw==1)//want to withdraw
<br/>
{
<br/>
AccountReceivable ar=new AccountReceivable();
<br/>
}
<br/>
else if(deposit==1)//want to deposit
<br/>
{
<br/>
AccountsPayable ap=new AccountsPayable();
<br/>
}
<br/>
}


<br/>
class AccountsPayable
<br/>
{
<br/>
....
,.....
<br/>
}

<br/>
----------

<br/>
class AccountReceivable 
<br/>
{
<br/>
}

Ads









Related Tutorials/Questions & Answers:
Inheritance in Hibernate - Hibernate Interview Questions
Achieve Inheritance in Hibernate - Hibernate Interview Questions
Advertisements
Java Inheritance and abstract - Java Interview Questions
question1 - Java Beginners
inheritance
inheritance
Inheritance,Inheritance in Java,Java Inheritance
multiple inheritance.
Core Java Interview Questions Page 2, Core Java QuestionQ
Inheritance
multiple inheritance
Java inheritance
javascript inheritance framework
Multiple Inheritance
Multiple Inheritance
Inheritance question?
Inheritance question?
inheritance
inheritance
Inheritance
inheritance
inheritance
Inheritance
Inheritance in Spring
Inheritance in java - Java Beginners
Inheritance
Inheritance in java - Java Beginners
inheritance - Java Beginners
Concept of Inheritance in Java
creating inheritance of cars
Maven's order of inheritance

Ads