Flipkart Interview Report
- 0of 0 votes
AnswersYou have a student class which have String firstName, boolean isBoy and int age. Write equals method for the class.
I wrote it then he asked there is a class Student2 which extends from this and has lastName field as well.
NowStudent s1 = new Student("firstName", 23, true); Student s2 = new Student("firstName", "lastName", 23, true);
what will s1.equals(s2) will return. Is it correct ?
- prit January 26, 2011| Report Duplicate | Flag | PURGE
Flipkart Software Engineer / Developer Java
CareerCup is the world's biggest and best source for software engineering interview preparation. See all our resources.