기존에 공부 해왔던 내용을 이제서야 적게 된다
데이터와 연산자에 대한 구분에 대해서 공부를 다시 해보았다.
public class Datatype{ //Datatype 이라는 클래스 생성
public static void main(String[] args) {
System.out.println(6); // 숫자 6을 출력
System.out.println("six"); // 문자열 six를 출력
System.out.println("6"); // 문자열 6을 출력
System.out.println(6+6); // 6+6 연산 실행
System.out.println("6"+"6"); // 문자열 6이라는 문자와 6이라는 문자를 합친 결과값을 나타냄
System.out.println(6*6); // 6*6 = 36 곱하기 계산을 나타
System.out.println("1111".length()); // 1111에서 문자열이 몇개인지를 확인할수있음
System.out.println("Hello World"); // Hello world 라는 문자열 출력
System.out.println('H'); //Char 형식의 문자열 출력
System.out.println("H"); String 형식의 H 출력
}
}
'JAVA' 카테고리의 다른 글
자바 기초다지기(#8) (0) | 2020.09.22 |
---|---|
#자바 기초다지기(#7) (0) | 2020.09.22 |
자바 기초 다지기 (#5) (0) | 2020.09.21 |
자바 기초 다지기 #4 (0) | 2020.09.11 |
자바 기초 다지기 #3 (0) | 2020.09.11 |