Here is some code in java on data types:
class Test
{
public static void main(String args[])
{
int i = -0777;
System.out.println(i);
}
}
Output code above -511
If the code is changed to:
class Test
{
public static void main(String args[])
{
int i = -777;
System.out.println(i);
}
}
The output is -777.
Why is the day off different? What are the calculations performed for this code?
source
share