프로그래밍/Scala 썸네일형 리스트형 PART 1 - Functional Programming with Function Applications (3) 4차시 수업에 해당하는 내용이자 저 긴 제목의 마지막!!!!! ▶ Conditional Expression If-else 형식 : if (b) e1 else e2 b : Boolean expression e1, e1 : same type if (true) e1 else e2 -> e1 if (false) e1 else e2 -> e2 def abs(x:Int) = if (x>=0) x else -x ▶ Boolean Expressions true / false !b b && b b || b && : AND 연산자 ( 둘다 true 여야 true 출력) | | : OR 연산자 (둘중 하나라도 true면 true 출력) ! : NOT 연산자 a >= b a > b a Boolean)= if (x) y els.. 더보기 Scala 란 스칼라의 특징 및 장점 파이썬처럼 간결한 문법으로 되어있음 객체지향과 함수형 프로그래밍이 모두 가능 자바와 호환 JVM 위에서 실행되기 때문에 성능이 좋음 정적 타입을 지향 REPL shell을 활용해서 Scripting Imperative vs Functional Programming 비교 ▶ Imperative Programming Computation by memory reads/writes Sequence of read/write operation Repetition by loop More procedual (describe how to do) Easier to write efficient code 예 ) Java, Javascript, C++, Python, Rust, ... ▶ Function.. 더보기 이전 1 2 3 다음