if statment

Ok… this is awkward but this is getting me cray but something is wrong and I can’t see what its wrong…


		System.out.println(getTime());	
		if (getTime() == getTime()) {
			System.out.println("WORK!!!!!");	
			brightness = -120;
		} else {
			System.out.println(getHour() + ":" + getMinutes() + ":" + getSeconds() + "-" + "00:00:00");				
		}

print:


00:00:00
00:00:00-00:00:00
00:00:00
00:00:00-00:00:00
00:00:00
00:00:00-00:00:00

getTime()


	public static String getTime() {
		return getHour() + ":" + getMinutes() + ":" + getSeconds();
	}

Why its now getTime() == geTime?!?!?!

Looks like you’re returning a string from that function, and to check string equality you need to use .equals()… == will always return true.

Thats right… I always forget that…
tks