public class THROW1
{
static void function(int marks,int age)
{
if(marks<70 && age>19)
{
throw new ArithmeticException("U R Eligible");
}
else
{
System.out.println("Welcome");
}
}
public static void main(String args[])
{
function(60,20);
System.out.println("...U Can Join...");
}
}
{
static void function(int marks,int age)
{
if(marks<70 && age>19)
{
throw new ArithmeticException("U R Eligible");
}
else
{
System.out.println("Welcome");
}
}
public static void main(String args[])
{
function(60,20);
System.out.println("...U Can Join...");
}
}
No comments:
Post a Comment
Note: only a member of this blog may post a comment.