Advertisement
ismail5g

Question-5

Apr 14th, 2018
79
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.50 KB | None | 0 0
  1. import java.util.Scanner;
  2. import java.util.Arrays;
  3. class Bank{
  4.     public static void main(String[] args){
  5.         Scanner ob = new Scanner(System.in);
  6.         double a = ob.nextDouble();
  7.         int b= ob.nextInt();
  8.         float [] tb= new float[b];
  9.         try{
  10.             tb[b]=12;
  11.             System.out.println(tb[b]);
  12.         }
  13.         catch(ArrayIndexOutOfBoundsException ex){
  14.             System.out.println("Exception: ArrayIndex Out Of Bounds Exception");
  15.         }
  16.        
  17.     }
  18. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement