JAVA
java
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
import java.util.Scanner;
public class Program{
public static void main(String[] args){
/*
in this code i want that when the user inputs hello or Hello, then the output should be hello there can i know why its not printing hello there even after typing hello
*/
Scanner b = new Scanner(System.in);
String input = b.nextLine();
if(input.equals("hello") || input.equals("Hello")){
System.out.println("hello there");
}else{
System.out.println("not recognized");
}
}
}
Enter to Rename, Shift+Enter to Preview
OUTPUT
Run