Hi guys just wondering if you could help me out, could you tell me what i am doing wrong here, what i am trying to do is add 1 if r is typed and subtract 1 if L is typed for both the lower and upper cases. but the position keeps returning the original. please help!!
int position = 0;
System.out.print("move: ");
String car = Global.keyboard.nextLine();
if (car == "r/")
position = + 1;
if (car == "R")
position = +1;
if (car == "l")
position = -1;
if (car == "L")
position = -1;
System.out.print(position);