Java Programming Language

Published: Wednesday, 2 November 2005

JVM Arguments

Acquiring at Runtime

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

This has been available since release 1.5

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      "

More Articles

Java Programming Language