1,printf() メソッドは、フォーマットに用いるメソッドです。
2,ソースコード
public class Main {
	public static void main(String[] args) {
		System.out.printf("%d This is a format String ", 123);
		boolean myBoolean = true;
		char myChar = '@';
		String myString = "hiro";
		int myInt = 50;
		double myDouble = 1000;
		System.out.printf("%b", myBoolean);
		System.out.printf("%c", myChar);
		System.out.printf("%s", myString);
		System.out.printf("%d", myInt);
		System.out.printf("%f", myDouble);
		System.out.printf("Hello %10s", myString); //
		System.out.printf("Hello %-10s", myString); //
		System.out.printf("You have this much money %.2f", myDouble);
		System.out.printf("You have this much money %.1f", myDouble);
		System.out.printf("You have this much money %f", myDouble);
		System.out.printf("You have this much money %+f", myDouble);
		System.out.printf("You have this much money %020f", myDouble);
		System.out.printf("You have this much money %,f", myDouble);
	}
}
Java チュートリアル
 Java テキストファイル(.txt .csv)への出力 java.io.FileWriter : 
here
  Java テキストファイル(.txt .csv)からの入力 java.io.FileReader : 
here
  Java モニターからの入力 java.util.Scanner : 
here
  Java GUIからの入力 javax.swing.JOptionPane : 
here
  Java Mathクラス Math.sqrt : 
here
  Java 乱数の生成 java.util.Random : 
here
  Java Stringクラス : 
here
  Java Wrapperクラス : 
here
  Java ArrayListクラス java.util.ArrayList : 
here
  Java メソッド(method)の作り方とオーバーロード : 
here
  Java printf()メソッド : 
here
  Java オブジェクト(Object Oriented Programming)とコンストラクタ、スコープ(local,global) : 
here