johnnywishbone wrote:AndroidMan wrote:
Damn, I was really trying to ace this internet pop quiz as well. i didn't even bother google the info. Damn it.
swap(int a, int b)
{
int temp = a;
a = b;
b = temp;
}
Sure you didn't? http://stackoverflow.com/questions/1039 ... es-in-java
certainly didn't google for inheritance and interfaces, but most def did for swap function. Even better if using instance variables for classes, assuming there are appropriate setter and getter methods contained in the skeleton of the class as required, which I'm not writing out.
public void swap( AndroidMan a, AndroidMan b ) {
int JInt;
JInt; = a.getJInt();
a.setJInt(b.getGetJInt());
b.setJInt(JInt);
}