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 Answer
+ 3
Missing a '}' after System.out.println(b);
20th Mar 2021, 3:50 PM
äœ çŸ„é“èŠć‰‡ïŒŒæˆ‘äčŸæ˜Ż
äœ çŸ„é“èŠć‰‡ïŒŒæˆ‘äčŸæ˜Ż - avatar