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



Employee has a Passport. here employee is an object and passport is an object, give the class desi..

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

Employee has a Passport. here employee is an object and passport is an object, give the class desi..

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

Employee has a Passport. here employee is an object and passport is an object, give the class desi..

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

Post New Answer

More Java Related AllOther Interview Questions

Spring framework ---Can somebody explain me in easily understandable format about AOP, IOC and DI, so that i can explain in interview rather than just telling what is available in net. I am not able to understand that also. I am new to Spring

0 Answers  


What is javax annotation generated?

0 Answers  


Who developed rxjava?

0 Answers  


What is predicate in lambda expression?

0 Answers  


What is the use of jprofiler?

0 Answers  






What is gpt and gpc? : java security

0 Answers  


How do javabeans work?

0 Answers  


Explain the inheritance principle.

0 Answers  


What is dto layer in java?

0 Answers  


Why java is better than node.js?

0 Answers  


What is a stream in java?

0 Answers  


What are java’s rules regarding tabs, spaces and newline characters?

0 Answers  


Categories