ConsoleOutputEx02 - printf( )메소드를 통한 문자열 조합

CODEDRAGON Development/Java

반응형

printf( )메소드를 통한 문자열 조합

   

소스코드

   

public class ConsoleOutputEx02 {

 

public static void main(String[] args)

{

 

//JDK 1.5이상부터 사용가능합니다.

System.out.printf("정수는 %d, 실수는 %f, 문자는 %c, 문자열는 %s", 7, 3.14F, 'J', "Love");

 

}

}


   

   

출력결과

   

반응형

'Development > Java' 카테고리의 다른 글

ConsoleOutputEx03 - printf( )를 통한 실수 표현 출력  (0) 2015.07.08
ConsoleOutputEx04 - %서식문자 확인  (0) 2015.07.07
JDK 설치 - 단계별 Step by Step  (0) 2015.07.06
switch문  (0) 2015.07.05
Eclipse version – MARS updated  (0) 2015.07.05