class Tank{
int level;
}
class aliasing{
public static void main(String args[]){
Tank t1 = new Tank();
Tank t2 = new Tank();
t1.level=21;
t2.level=32;
System.out.println("t1: " + t1 + " t2: " + t2);
}
}
This block of code produces the output: t1: Tank@1b4b24d t2: Tank@260829. Obviously this is wrong, but i don't know why all of a sudden all my code is producing nosense. Also, if i just intiliaze a primitive value i can print that out no problem with the correct value, so i don't know why only objects are messing up.