I've been racking my brain trying to figure out why my if statements won't print, can someone offer some help?
import java.util.Scanner;
public class Sound{
public static void main(String[] args){
Scanner x = new Scanner(System.in);
System.out.println("Enter the type of medium: ");
String medium = x.nextLine();
System.out.println("Enter the distance traveled: ");
double distance = x.nextDouble();
if(medium == "air"){
double time = distance/1100;
System.out.println("This is how long it takes: " + time);
}
else if(medium == "water"){
double time = distance/4900;
System.out.println("This is how long it takes: " + time);
}
else if(medium == "steel"){
double time = distance/16400;
System.out.println("This is how long it takes: " + time);
}
}
}