Exception Handling

Write a program in java to take input as age if it is less than 18 generate arithmetic exception otherwise print “Welcome to the group of votes”?

class Votes {       public static void main(String arg[])       {             try             {                   int age=Integer.parseInt(arg[0]);                   if(age<18)…

Read More

Write a program in java to demonstrate exception handling with multiple try block?

class MultipleTryBlock {       public static void main(String arg[])       {             try             {                   System.out.println(“Hii”);                   try                  …

Read More