Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // Scala Functions
- def isPrime(natNum:Int): Boolean = {
- asdf
- }
- inside paren is variable types and outside is the return type
- analogue is public boolean isPrime
- =====
- // Variables
- var name:String = "tom"
- val name:String = "tom"
- var can be reassigned but val cannot-- different from being immutable
- val my_array = Array(1,2,3,4)
- cannot do my_array = my_array2
- but you can do my_array(3) = 17
- ===
- See notes on HW 1
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement