kotlin - hello world

IKNOW·2023년 10월 28일
0

kotlin study

목록 보기
1/5
fun main() {
	println(Hello world!")
}
  • fun은 함수를 선언하는데에 사용된다.
  • main함수는 프로그램의 시작지점이다.
  • 함수의 바디는 중괄호(curly braces)로 나타낸다.
val popcorn = 5
val hotdog = 7
var customers = 10

customers = 8
println(customers)
  • 상수는 val(value)로 나타낸다.
  • mutable 변수는 var로 나타낸다.
val customers = 10
println("there are $customers customers")
println("there are ${customers +1} customers")
  • string template을 사용해서 변수나 객체에 저장된 데이터에 접근하여 문자열로 변환할 수 있다.
profile
조금씩,하지만,자주

0개의 댓글

관련 채용 정보