코틀린 Kotlin

프로그램 (Program) 용어 및 톺아보기

leexx 2023. 2. 3. 17:00

용어

Program 프로그램

일련의 순서에 따라 실행되는 instructions (statement, 명령문) 의 sequence 를 말한다.

 

Statement (programming statement) 명령문

A statement (or a programming statement) is a single command to be executed (like printing a text);

Statement is a single action;

한 줄로 이루어진 하나의 명령문 을 말한다.

 

Expression 표현식

An expression is a piece of code that produces a single value (for example, 2*2 is an expression);

단일 값을 반환 하는 코드 조각 을 말한다.

 

Block 블록

여러개의 statement (명령문) 가 중괄호 {...} 로 묶인 하나의 그룹 이다. 프로그램은 단일 블록으로 구성된다.

 

Keyword 키워드, 예약어

Keyword is a word that has a special meaning in the programming language;

프로그래밍 언어에서 특별한 의미 를 갖는 단어이다. keywords 는 바꿀 수 없다.

 

Identifier (name) 식별자

Identifier is a word written by a programmer that identifies an entity in a program;

프로그래밍 언어에서 무언가를 식별하기 위한 단어 이다.

 

 

톺아보기

fun main() {
    println("Hello, World!")
}
  • fun 은 함수를 정의하는 Keyword 키워드 이다. 이 함수의 이름은 main 인데, main 함수는 Kotlin 프로그램의 시작점 (entry point) 이다. MAIN 혹은 Main 은 시작점이 될 수 없다.
  • println("Hello, World!") 는 인자로 받은 문자열을 화면에 출력하는, 한 줄로 이루어진 하나의 Statement 명령문 이다.

 

참고자료

https://hyperskill.org/learn/step/4362

 

Overview of the basic program – JetBrains Academy — Learn programming by building your own apps

In this lesson, you will write your first Kotlin program, which prints "Hello, World!" This is the first step that every beginner is to take. Although the program itself is very simple, it is still a working program, and it shows the basic syntax of the pr

hyperskill.org