DEV Community

Amit Mishra
Amit Mishra

Posted on • Updated on

Are you Java expert? What will be the output of the given code snippet?

Are you Java expert?

What is the output of 

System.out.println(0123);
Enter fullscreen mode Exit fullscreen mode

If you know the answer it's good,
If not then surely you'll learn some really cool concept of Java 😄🤗.

Don't click on the link,😎
First comment your answer.
https://www.javaoneworld.com/2019/10/System-out-println-0123.html

Top comments (6)

Collapse
 
amymishra11 profile image
Amit Mishra

It's cool right.

Collapse
 
the_unconventional_coder profile image
ABHINAVA GHOSH (he/him)

octal !

Collapse
 
amymishra11 profile image
Amit Mishra

Yes yes , you get it, concept wise you are absolutely right

Collapse
 
shaijut profile image
Shaiju T • Edited

Hi, why it shows 83 ? if zero is removed it works fine.

Collapse
 
amymishra11 profile image
Amit Mishra

That's why I put the questions here.
All the magic you are seeing in this statement is just because of 0.
Follow the link to know why?
javaoneworld.com/2020/05/why-outpu...

Collapse
 
amymishra11 profile image
Amit Mishra

Yes yes... If anyone facing this first time, surely he'll surprise.