17일차-2

백엔드를 팝니다·2024년 7월 17일

개발자 수업

목록 보기
12/72

JAVA_CHAP.01~02

public class Sec01 {
public static void main(String[] args) {
// : 예제 : Hello World
// :출력 단축키 : sout
// : 메인 함수 단축키 : main
System.out.println("안녕하세요");
// TODO: 간단연습 : 안녕하세요 출력
System.out.println("Hello World");
System.out.println("ㅇㅇ");
}
}

// TODO : 1) main() 함수: 프로그램을 실행시키는 함수
// TODO: 2) 자바 출력함수 : 단축키 - sout
// TODO: 3) 변수 : 1가지 값을 저장하는 곳, 수정가능

  • 숫자 자료형 : 1, 2, 3 ->변수 int(정수,숫자) num = ?;

//TODO: 문자열(string) : " " 이용해서 표시
//문자열 붙이기 연산자 +
System.out.println("Hello" + " World");

// TODO: 4) 연산자 : 사칙연산 (+, -, , / , %)
int hour = 3;
int total =(hour
60) + 4; // 시 -> 분으로 바꾸기 (시 * 60)
System.out.println(total);

profile
백엔드 고수가 되고싶은 사람

0개의 댓글