我的程序在 readLine 调用后卡住了,if 语句不起作用。我究竟做错了什么?#java-first-timer
import java.io.InputStreamReader;
import java.io.BufferedReader;
import java.io.IOException;
public class nums {
public static void main(String[] args) throws IOException {
BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
System.out.println("Number Mania!!!");
System.out.println("Pick your favourite number from 1 to 5");
String favNum = br.readLine();
if (favNum=="3"){
System.out.println("Your favourite number is three!");
}
else{
System.out.println("hi!");
}
}
}