开始使用免费开始使用

Pros and cons of immutability

At first think, it seems like having a variable that you can't change is a terrible idea and that we should always use var instead of val. But, in Scala, we actually prefer immutable variables (val, that is) where possible.

In this exercise, you'll categorize statements about immutability as either a pro or a con.

本练习是课程的一部分

Introduction to Scala

查看课程

动手互动练习

通过我们的互动练习之一,将理论转化为实践

开始练习