Latest Tutorials| Questions and Answers|Ask Questions?|Site Map



Home Answers Viewqa Java-Beginners Inheritance question?

Have Programming Question? Ask it here!
 
 
 


Vinay Kumar Singh
Inheritance question?
1 Answer(s)      3 years and 5 months ago
Posted in : Java Beginners


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


Advertisement
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/>
}


Related Tutorials/Questions & Answers:
Advertisements
Advertisements
 

 

 

DMCA.com