Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

Compare objects of different classes in java .

Posted on 2013-11-21
1
Medium Priority
?
166 Views
Last Modified: 2014-01-21
I have 2 value objects or datamodel objects . They have close to 15 getters and setter methods . everytime i will have to compare these two objects by manually using if equals etc .
Is there something I can use to compare a few methods in 2 different objects ?
0
Comment
Question by:FranklinRaj22
1 Comment
 
LVL 86

Accepted Solution

by:
CEHJ earned 2000 total points
ID: 39667713
Have a look at the Commons Lang api. There's a default equals implementer in there that uses reflection
0

Featured Post

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

An old method to applying the Singleton pattern in your Java code is to check if a static instance, defined in the same class that needs to be instantiated once and only once, is null and then create a new instance; otherwise, the pre-existing insta…
Introduction This article is the first of three articles that explain why and how the Experts Exchange QA Team does test automation for our web site. This article explains our test automation goals. Then rationale is given for the tools we use to a…
Viewers learn about the “for” loop and how it works in Java. By comparing it to the while loop learned before, viewers can make the transition easily. You will learn about the formatting of the for loop as we write a program that prints even numbers…
Viewers learn about the scanner class in this video and are introduced to receiving user input for their programs. Additionally, objects, conditional statements, and loops are used to help reinforce the concepts. Introduce Scanner class: Importing…
Suggested Courses

773 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question