I need help for this scanner input | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

I need help for this scanner input

hello i tried this code but i got lots of error ...please help public static void main(String[] args){ String input ="1 wine 5 white wine red wine"; try (Scanner s = new Scanner(input).useDelimiter("\\s*wine\\s*")) { System.out.println(s.nextInt()); System.out.println(s.nextInt()); System.out.println(s.next()); System.out.println(s.next()); } } }

7th Oct 2016, 10:09 PM
Mam
1 Answer
+ 1
import java.util.Scanner
20th Oct 2016, 11:26 AM
imaqtpie
imaqtpie - avatar