What is the output of this program ?
class Literal3
{
public static void main(String[] args)
{
int i=0xFace;
System.out.println(i);
}
}
/*
Output:- 64206
Explanation:- In hexadecimal number, allowed digits are 0 to 9 and a to f either lower or uppar case letter. This is one of the very few area where Java is not case sensitive.
So "Face" is converted into decimal number and we got output as 65206.
*/
{
public static void main(String[] args)
{
int i=0xFace;
System.out.println(i);
}
}
/*
Output:- 64206
Explanation:- In hexadecimal number, allowed digits are 0 to 9 and a to f either lower or uppar case letter. This is one of the very few area where Java is not case sensitive.
So "Face" is converted into decimal number and we got output as 65206.
*/
0 comments: