Java Programming Language

JVM Arguments

Acquiring at Runtime


        List<String> args = ManagementFactory.getRuntimeMXBean().getInputArguments();
      

This works in 1.5 only

Snippets

printf pad left with 0 zeros


          String.format("%04d", flight.getFlightNumber());
      

Printf formatting was introduced in java 1.5

printf right pad with spaces, width of 10


         String.format("%-10s", "test");
         // will equal "test      "
      

Published: Wednesday, 2 November 2005