WON.dev
chapter07 : castingEx 본문
package org.joonzis.ex;
public class Ex07_castingEx {
public static void main(String[] args) {
// 1. 줄 바꿈
System.out.println();
// 2. 숫자 + 연산자
System.out.println(1 + 1);
System.out.println(1.5 + 1);
// 3. 문자열 + 연산자
System.out.println("Hello " + "Java");
// 4. 숫자와 문자열 + 연산자
System.out.println(100 + "원");
System.out.println(100 + 100 + "원");
System.out.println("$" + 100);
System.out.println("$" + 100 + 100);
}
}
'JAVA > chapter02_variable_dataTaye' 카테고리의 다른 글
chapter09 : escape (0) | 2023.05.25 |
---|---|
chapter08 : parsing (0) | 2023.05.25 |
chapter06 : casting (1) | 2023.05.25 |
chapter05 : literal (0) | 2023.05.25 |
chapter04 : String (0) | 2023.05.25 |