I am new to Java and trying to learn by practicing. I am not sure where I am going wrong in my if statement, it seems that after I type r (I believe scanner is storing this in value) the first part of the if statement does not initialize and instead the else statement initializes.
import java.util.Scanner;
import java.util.concurrent.ThreadLocalRandom;
public class T2 {
public static void main(String args[]){
Scanner input = new Scanner(System.in);
T2_2 T2_2Object = new T2_2();
System.out.println("What is your favorite color? (Enter 0 if unsure) ");
String value = input.nextLine();
if (value == "r"){
int value2;
value2 = ThreadLocalRandom.current().nextInt(1,10);
String value3 = Integer.toString(value2);
System.out.println(value3);