1

This question is a part of OCP test series .

> Integer i=new Integer(100_00);

I tried to understand how this works but so far i have only got this much that this is one of a message format . Please provide some clarity as to how we can pass a numeric value with a underscore . Pardon me if this is a simple concept but i am kind of anxious to know this .

Nishant_Singh
  • 748
  • 1
  • 6
  • 16

1 Answers1

5

Java allows numeric literals with _ for better readability.

For example:

int i = 10_000;
float pi =      3.14_15F;
jmj
  • 237,923
  • 42
  • 401
  • 438