+ 1

How to track an input string in Java??

Suppose I'm letting the user to input hundreds of string and whenever an user inputs "New York"....then an output should be generated that someone has just entered "New York".....so that's it......please anyone can help

9th Feb 2018, 11:18 PM
Sabit - avatar
1 Answer
+ 5
//example String str = "New York"; if(str.equalsIgnoreCase("New York"){System.out.print("New York was entered");} /*You could use an array and run through the array untill the condition is true*/
10th Feb 2018, 12:36 AM
D_Stark - avatar