-
-
Save 5AbhishekSaxena/376903da89317bd3fdf8a34941574457 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Education( | |
school: String, | |
yearOfPassing: Int?, | |
degree: String? // optional | |
) { | |
val school: String | |
val yearOfPassing: Int | |
val degree: String? // optional | |
init { | |
if (school.isBlank()) | |
throw IllegalArgumentException("School must not be blank.") | |
if (yearOfPassing == null) { | |
throw IllegalArgumentException("School must not be blank.") | |
} | |
this.school = school | |
this.yearOfPassing = yearOfPassing | |
this.degree = degree | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment