728x90

[ String의 특징 ]

String dept = "Salesman";
char letter = 'A';
		
String course = dept + 250;
String grade = letter + " ";
		
String courseInformation = course + ": " + grade;
System.out.println(courseInformation);

# 결과 : Salesman250: A 

# 분석 : 

 1) String은 int type도 같이 쓸 수 있다.

 2) String은 char type도 같이 쓸 수 있다.

 

728x90

+ Recent posts