File tree Expand file tree Collapse file tree 1 file changed +3
-1
lines changed Expand file tree Collapse file tree 1 file changed +3
-1
lines changed Original file line number Diff line number Diff line change @@ -7,10 +7,12 @@ import scala.beans.BeanProperty
7
7
*
8
8
* call another constructor by invoking this
9
9
*
10
+ * Scala does not have Checked Exceptions. All Exceptions are unchecked in scala, even SQLException and IOException
11
+ *
10
12
*/
11
13
class Employee (@ BeanProperty val firstName : String , @ BeanProperty var lastName : String , @ BeanProperty val title : String ) // This is default constructor
12
14
{
13
- require(firstName.nonEmpty, " First Name cannot be empty!!" ) // preconditions using require
15
+ require(firstName.nonEmpty, " First Name cannot be empty!!" ) // preconditions using require. If not met, will throw IllegalArgumentException
14
16
require(lastName.nonEmpty, " Last Name cannot be empty!!" )
15
17
require(title.nonEmpty, " Title cannot be empty!!" )
16
18
You can’t perform that action at this time.
0 commit comments