Get closer to the machine level and consider how a computer actually stores values (i.e. all variables are numbers) and it’ll make sense.
It certainly works in C; claiming a syntax error isn’t really in the spirit of the question. I wrote an answer in response to the original problem comment.
It might need some small changes to work in java to deal with primitives not being objects, but the basic idea will be the same without actually changing the types
15
u/theXpanther Jan 05 '19
It will work in Java, c#, or any other c based language as well