So, I just started reading "Java In A Nutshell", and the first chapter says that:
"To include a character literal in a Java program, simply put it between single quotes," that is.
char c = 'A';
What exactly does this do? I thought that char took only the values ββ0 - 65535. I do not understand how you can assign it an βAβ?
Can you also assign 'B' to int?
int a = 'B'
The output for 'a' is 66. Where / why would you use the operation described above?
Sorry if this is a stupid question.
My whole life has been a lie.
java
Adz
source share