Using the integer conversion characters. - Java Language Basics

Java examples for Language Basics:Number Format

Description

Using the integer conversion characters.

Demo Code

public class Main
{ 
   public static void main(String[] args)
   {/*from w w  w  . j a v a 2  s  . com*/
      System.out.printf("%d\n", 26); 
      System.out.printf("%d\n", +26);
      System.out.printf("%d\n", -26);
      System.out.printf("%o\n", 26); 
      System.out.printf("%x\n", 26); 
      System.out.printf("%X\n", 26);
   } 
}

Result


Related Tutorials