0

What's the problem?

import java.util.Scanner; public class Program { public static void main(String[] args) { Scanner s = new Scanner(System.in); try{ String x = s.nextLine(); String y = s.nextLine(); System.out.println (x); System.out.println (x.charAt (0)); } catch (Exception e){ System.out.println ("something went wrong"); } } }

20th Apr 2020, 7:27 PM
Yahel
Yahel - avatar
4 Answers
0
~ swim ~ I wanted to make "2 Scanners" that in the first one I write a word and at the second i write the charAt()... (the number of the letter I want)...
20th Apr 2020, 7:35 PM
Yahel
Yahel - avatar
0
~ swim ~ alright thanks
20th Apr 2020, 7:46 PM
Yahel
Yahel - avatar