Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
pp:2024:scala:l04 [2024/03/24 21:46]
tpruteanu
pp:2024:scala:l04 [2024/03/25 10:07] (current)
costin_andrei.vlad
Line 29: Line 29:
  
 ==== 4.2 Option ==== ==== 4.2 Option ====
-Option = carrier (like a box or a container) for a single or no element, of a given type. (Ex. Some(_) or None)+Option = carrier (like a box or a container) for a single or no element, of a given type. (Ex. ''​Some(_)'' ​or ''​None''​)
  
 We use Option to write robust functions, in case they return null or fail to return an accepted value. We use Option to write robust functions, in case they return null or fail to return an accepted value.