0
About java
Why i put a char group = 'A'; and the output goes out 68,why? public class Program { public static void main(String[] args) { int value = 23; int res = value / 6; char group = 'A'; System.out.println(group+res); } }
2 Answers
+ 11
â ASCII code value of character literal 'A' is 65
â 23/6 is 3
//integer/integer returns integer in java, after removing decimal part.
â implicit typecasting here, from char type to int type(2 bytes to 4 bytes).
â 65+3=68 returned as output.
+ 1
System.out.println(group+""+res);
Output: A3