+ 2
public class Main { public static void main(String[] args) { int a = 'a'; System.out.print(a); } }
out put is 97 , how
6 Réponses
+ 1
Here comes the concept of widening
Int type have 4Bytes of memory wr as char have 2Bytes of memory. So storing or converting smaller one into bigger one does not cause any data loss. So ASCII value of char is assigned to int
+ 10
output is 97 because you hava initialized character 'a' as integer type so the output is given as ASCII(American Standard Code For Information Interchange)
So ASCII values of char A - Z is 65-90 and char a-z is 97-122. As you have written small a its value is 97
+ 8
welcome
+ 2
1. Java program to convert string into mm/dd/yyyy format
+ 1
thanks buddy
+ 1
thanks