| New Reply |
Comparing class objects |
Share Thread | Thread Tools |
| Aug16-11, 11:12 PM | #1 |
|
|
Comparing class objects
Hi,
I have a class, say myclass and it takes two strings (let s and g ) and one int ( say i) as its arguments. It looks like, public class { String s , g; int i ; public void myclass(String sname, String gname, int k){ s = sname; g = gname; i = k; } } Now, I have several objects of this class with different values of s, g and i. I want to compare them for equality. i.e if two class objects have same s g and i value, then i want true as my output. I know this can be done by a loop but is there any shorter way to do this? |
| Aug16-11, 11:21 PM | #2 |
|
|
|
| Aug17-11, 12:28 PM | #3 |
|
Mentor
|
|
| New Reply |
| Thread Tools | |
Similar Threads for: Comparing class objects
|
||||
| Thread | Forum | Replies | ||
| Waitlists to get into class at junior college math class ? | Academic Guidance | 16 | ||
| How could I call a base class virtual function from the derived class ? (C++) | Programming & Comp Sci | 2 | ||
| Why does Chern class belong to INTEGER cohomology class? | Differential Geometry | 41 | ||
| How does a Physics class differ from an Engineering class? | Academic Guidance | 38 | ||
| Help- comparing objects in free fall | Introductory Physics Homework | 5 | ||