0

Casting in Java

Can someone tell me what I've done wrong here? I have to output the int value of a char using cast. import java.util.Scanner; class Main { public static void main(String[] args) { Scanner read = new Scanner(System.in); char a = read.next().charAt(0); //your code goes here int b =(int)a; System.out.println(b); }

20th Mar 2021, 2:28 PM
Zotta
Zotta - avatar
1 Resposta
+ 3
Missing a '}' after System.out.println(b);
20th Mar 2021, 3:50 PM
你知道規則,我也是
你知道規則,我也是 - avatar