Quantcast
Channel: Best way to compare multiple fields of objects in java? - Stack Overflow
Viewing all articles
Browse latest Browse all 2

Best way to compare multiple fields of objects in java?

$
0
0

I want to compare 2 object as same class,i want to konw What's the difference between two filed of the object,for example,

public class Person{  private String name;  private int age;  ......}Person person1 = new Person();person1.setName("jim");person2.setage(12);Person person2 = new Person();person2.setName("jason");person2.setage(14);

public Map compare(person1,person2)?

tell me name is different and age is different?


Viewing all articles
Browse latest Browse all 2

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>