import java.util.*; class NegativeAmountException extends RuntimeException { String msg; NegativeAmountException(String msg) { super(msg); } } public class lab28 { public static void main(String args[]) { Scanner sc=new Scanner(System.in); System.out.println("enter the amount:"); int amt=sc.nextInt(); if(amt<0) { throw new NegativeAmountException("INVALID AMOUNT......"); } else { System.out.println("amount deposited....."); } } }