Answers for "integer in java"

1

formatting an integer in java

Default formatting:

String.format("%d", 93); // prints 93


Specifying a width:

String.format("|%20d|", 93); // prints: |                  93|


Left-justifying within the specified width:

String.format("|%-20d|", 93); // prints: |93                  |


Pad with zeros:

String.format("|%020d|", 93); // prints: |00000000000000000093|
Posted by: Guest on May-02-2020
2

java what is integer

int i = 0;
Posted by: Guest on February-03-2021
2

int java

boolean result = true;
char capitalC = 'C';
byte b = 100;
short s = 10000;
int i = 100000;
Posted by: Guest on October-16-2020

Code answers related to "Java"

Java Answers by Framework

Browse Popular Code Answers by Language