1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 | public class Exam_03 { public static void main(String[] ar){ int a = 100; char b = 'A'; float c = 3.1415f; String d = "JAVA"; System.out.printf("a = %d\n", a); System.out.printf("b = %c == %d\n", b, (int)b); System.out.printf("c = %f\n", c); // 소숫점이하 6자리까지 출력된다. System.out.printf("c = %.2f\n", c); System.out.printf("name = %s\n", d); } } | cs |
'공부 > JAVA_source' 카테고리의 다른 글
자바 예외처리 (throws IOException) (0) | 2016.10.19 |
---|---|
자바 연산자 및 출력 형식 (0) | 2016.10.19 |
자바 System 클래스 (write/print/println/printf) (0) | 2016.10.19 |
자바 출력 스트림 (0) | 2016.10.19 |
자바 변수 (전역변수/지역변수) (0) | 2016.10.19 |