[JAVA] print, println, printf

보람·2023λ…„ 2μ›” 3일
0

JAVA

λͺ©λ‘ 보기
22/24
post-thumbnail

πŸ“Œ 예제λ₯Ό 톡해 μ•Œμ•„λ³΄κΈ°

println

            int a = 6;
            int b = 88;
            String s = "ν•˜λ‚˜";
		
		
            System.out.println(a + b + s);
            System.out.println("   ");
            System.out.println(a + b + s);		
            System.out.println(a + b + s);
            System.out.println("\t");
            System.out.println(a + b + s);
            System.out.println("\n");
            System.out.println(a + b + s);	
//μ μš©μ•ˆλ¨	System.out.println( "%d * %d = %2d", a, b, (a*b)); 

πŸ“‘ κ²°κ³Ό

            94ν•˜λ‚˜

            94ν•˜λ‚˜
            94ν•˜λ‚˜

            94ν•˜λ‚˜


            94ν•˜λ‚˜

print

            int a = 6;
            int b = 88;
            String s = "ν•˜λ‚˜";

            System.out.print(a + b + s);
            System.out.print("   ");
            System.out.print(a + b + s);		
            System.out.print(a + b + s);
            System.out.print("\t");
            System.out.print(a + b + s);
			System.out.print("\n");
			System.out.print(a + b + s);	
//μ μš©μ•ˆλ¨	System.out.print( "%d * %d = %2d", a, b, (a*b));

πŸ“‘ κ²°κ³Ό

            94ν•˜λ‚˜   94ν•˜λ‚˜94ν•˜λ‚˜	94ν•˜λ‚˜
            94ν•˜λ‚˜

printf

            int a = 6;
            int b = 88;
            String s = "ν•˜λ‚˜";

            System.out.printf(a + b + s);		
            System.out.printf(a + b + s);		
            System.out.printf(a + b + s);
            System.out.printf("\t");
            System.out.printf(a + b + s);
            System.out.printf("\n");
            System.out.printf(a + b + s);
            System.out.printf("   ");
            System.out.printf( "%d * %d = %2d", a, b, (a*b));

πŸ“‘ κ²°κ³Ό

            94ν•˜λ‚˜94ν•˜λ‚˜94ν•˜λ‚˜	94ν•˜λ‚˜
            94ν•˜λ‚˜   6 * 88 = 528
profile
μ•ˆλ…•ν•˜μ„Έμš”, ν•œλ³΄λžŒμž…λ‹ˆλ‹€.

0개의 λŒ“κΈ€