aspose file tools*
The moose likes Programmer Certification (SCJP/OCPJP) and the fly likes program needs to be explained Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of JavaScript Promises Essentials this week in the JavaScript forum!
JavaRanch » Java Forums » Certification » Programmer Certification (SCJP/OCPJP)
Bookmark "program needs to be explained" Watch "program needs to be explained" New topic
Author

program needs to be explained

Venkat Ramsimha
Ranch Hand

Joined: Dec 28, 2004
Posts: 127
the below program needs to be explained

thanks,
venkat ram simha

class SaveMe implements Serializable{
transient int x;
int y;
SaveMe(int xVal, int yVal) {
x = xVal;
y = yVal;
}
public int hashCode() {
return (x ^ y); //Legal, but not correct to
// use a transient variable
}
public boolean equals(Object o) {
SaveMe test = (SaveMe)o;
if (test.y == y && test.x == x) { // Legal, not correct
return true;
} else {
return false;
}
}
}
Alex Belisle Turcot
Ranch Hand

Joined: Apr 26, 2005
Posts: 516
Hi,

can you tell which part you don't understand.

transient, serializable, hashCode, ==, &&, equals, ^, passing primitives to fct, the use of transient variables...

So many things in the code, and there is no main.

regards,
Alex
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: program needs to be explained