NMP-Study / FunctionalProgrammingInScala

2 stars 0 forks source link

[스칼라+플레이] Chapter2.변수 다루기 #1

Closed duckcalf closed 5 years ago

duckcalf commented 5 years ago

변수 선언

var a = "변수입니다."
val b = "final 변수 입니다."

기본 자료형과 참조 자료형

tyep을 이용한 자료형 별칭

type Name = String
type Person = (String, Int)
type FType = String => Int

val name: Name = "홍길동"
val person: Person = ("홍길동", 30)
val f: FType = text => text.toInt

위와 같이 자료형에 alias를 걸 수 있음

enochyeon commented 5 years ago

블로그 글 참고