Employee has a Passport. here employee is an object and
passport is an object, give the class design
Answers were Sorted based on User's Feedback
Answer / pawan kumar mangal
class Passport{
private int NO;
private Date Issue Date;
private Date Validity;
public int getNO(){}
}
class Employ{
private Passport pass;
public Passport getPassport(){}
}
| Is This Answer Correct ? | 7 Yes | 0 No |
Answer / swati
Its a bidirectional association where is you can find
employee using passport AND find a passport using employee
Class Employee{
Name -
Address
Passport
}
Class Passport{
Name
Address
}
| Is This Answer Correct ? | 1 Yes | 2 No |
Answer / dhanshrikekre@yahoo.com
as much i cn understand ur questn..its lyk
emp. obj has the properties of passport obj.
class passport1
{
}
class employee1 extends passport
{
}
its a concept of inheritance..
class TMain
{
p s v m()
{
//obj of emp..1 as employee;
//it 'l access pass..1 class
//it cn b chckd by making passport obj.
}
}
}
| Is This Answer Correct ? | 2 Yes | 8 No |
What is proxy object in java?
why is java not 100% oops?
Explain different way of using thread?
What happens if javac is not recognized?
Describe life cycle of thread?
What is the difference between Logical Parallelism and Physical Parallelism?
What is numberformatexception in java?
What is data persistence in java?
Why sun introduce concept of anonymous class? What is need and real life use of anonymous class
In a barber shop there are 2 doors. customer come in 1 door, leave in other. minimum # of chairs. barber spend his life in cutting. always barber can cut 1 customer. few chairs in the shop. if barber busy customer waits, if chairs full, customer leave. if no customer, barber sleeps. treat barber and customer as 2 threads. you can use Semaphore class with arrive and depart and count as parameter.
What is a jvm?
In java what is the difference between sleep() and wait() .