Sunday, 11 August 2013

Wierd Syntax - Underscores between digits

Wierd Syntax - Underscores between digits

Per my usual, I have been working on more UIL Java practice sheets when I
came across this problem:
int _ = 8;
System.out.println(5_5);
The question was "What is the output of the following code piece?"
My first guess was a syntax error, but the correct response is actually 55.
Why is this?

No comments:

Post a Comment