What is the output of this program?
class Literal4
{
public static void main(String[] args)
{
int i=0xbeef;
System.out.println(i);
}
}
/*
Output:- 48879
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 48879.
*/
{
public static void main(String[] args)
{
int i=0xbeef;
System.out.println(i);
}
}
/*
Output:- 48879
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 48879.
*/
0 comments: