print 출력 :
: System.out.println() : ln을 사용하므로써 개행 실시
: System.out.print() : 개행없이 출력
: System.out.printf() : format이 있는 출력
package printex;
public class ColorPrintF {
public static void main(String[] args) {
System.out.printf("좋아하는 색상은 %s 입니다.","Red");
System.out.printf("색의 삼원색은 %s와 %s와 %s 입니다","Red","Green","Blue");
System.out.printf("%s과 %s을 섞으면 %s이 나온다.","Red","Green","Purple");
}
}
package printex;
public class ColorPrintF {
public static void main(String[] args) {
System.out.printf("내가 가장 좋아하는 색상은 %s 입니다.","Red");
System.out.println();
System.out.printf("색의 삼원색은 %s와 %s와 %s 입니다","Red","Green","Blue");
System.out.println();
System.out.println("---------------------------------");
System.out.printf("%s는 %s번 입니다","Red","1");
System.out.println();
System.out.printf("%o %x",10,10);
System.out.println();
System.out.printf("%s%n%s%n%s%n", "Red","Green","blue");
}
}
