DEV Community

Amit Mishra
Amit Mishra

Posted on • Edited on

3

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.

Billboard image

The Next Generation Developer Platform

Coherence is the first Platform-as-a-Service you can control. Unlike "black-box" platforms that are opinionated about the infra you can deploy, Coherence is powered by CNC, the open-source IaC framework, which offers limitless customization.

Learn more

👋 Kindness is contagious

Please leave a ❤️ or a friendly comment on this post if you found it helpful!

Okay