Skip to content

Commit

Permalink
exception handling demo: setting parameters in student class
Browse files Browse the repository at this point in the history
  • Loading branch information
NirmalSilwal committed Sep 2, 2020
1 parent 7775f8a commit 1f46145
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions CodingBlocks Training/Day15 Reference/studentClient.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
package OOPS;

public class studentClient {

public static void main(String[] args) throws Exception {

student s1 = new student();

s1.setRollno(-10); // Exception in thread "main" java.lang.Exception: rollno cannot be negative

}

}

0 comments on commit 1f46145

Please sign in to comment.