i switched lecturers today and he stated using a weird code too me.
he says its better. when i asked why, he asnwered "because it is!"
so much for that.
so heres an example:
if (o1.equals(o2))
{
System.out.println("Both integer objects are the same");
}
instead of what im used too:
if (o1 == o2)
{
System.out.println("Both integer objects are the same");
}
whats the difference between the two. and why is his way better?
found this but i cant really make sense of that answer http://www.javabeat.net/qna/13-what-is-difference-between-equals-and-/