Advertisement
Guest User

asdjlh

a guest
Dec 19th, 2012
725
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.54 KB | None | 0 0
  1. import java.util.*;
  2. public class Classname
  3. {
  4.     public static void main (String[] args)
  5.     {
  6.         Scanner in = new Scanner(System.in);
  7.         System.out.print("An integer between 1 and 10: ");
  8.  
  9.         try {
  10.             int x = in.nextInt();
  11.             int y = testmetod(x);
  12.         }
  13.         catch (Exception e){
  14.             System.out.println("The variable is out of bounds.");
  15.         }
  16.  
  17.     }
  18.  
  19.     public static int testmetod(int z) throws Exception
  20.     {
  21.         if (z < 1||z > 10){
  22.             throw new Exception("Variable is not within range.");
  23.         }
  24.         else if () {  // <--------------------
  25.         }
  26.     }
  27.  
  28.  
  29. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement