can this be used for user inputs | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 2

can this be used for user inputs

29th Oct 2016, 6:19 PM
Abdul Fatawu Jaman
5 Answers
+ 3
yes of course . ex: Scanner scanner=new Scanner(System.in); String name=scanner.nextLine(); if(name.exualsToIgnoreCase("bayram")) System.out.println("welcome Bayram"); else System.out.println("nice to meet you"+name);
29th Oct 2016, 6:30 PM
bayram akdemir
bayram akdemir - avatar
+ 1
yes of course u can. For examle Scanner sc = new Scanner(System. in) ; System. out. print("Enter a value :") ; int value = sc. nextInt() ; if (value<0) System. out. println("Please enter a positive number. ") ;
3rd Nov 2016, 4:01 PM
Muhammet Şeramet
Muhammet Şeramet - avatar
0
what does it mean
29th Oct 2016, 6:24 PM
bayram akdemir
bayram akdemir - avatar
0
can I use the if condition for scanner variables( input from the user)
29th Oct 2016, 6:26 PM
Abdul Fatawu Jaman
0
Yes u can
29th Jan 2017, 2:11 PM
raju roxx
raju roxx - avatar