All pastes #791326 Raw Edit

Unnamed

public text v1 · immutable
·published 2007-11-20 20:48 UTC
rendered paste body
import java.util.*;
public class test 
{
	public static void main(String[] args)
    {
		Exceptions e1 = new Exceptions();
		boolean state = true;

		while(state)
		{
			Scanner input = new Scanner(System.in);
			System.out.print("Enter numbers: ");
			String str1 = input.nextLine();
			String[] str2 = str1.split(" ");
        
			int[] numbers = new int[str2.length];
        
			for (int i=0; i< 1 3numbers.length; i++) 
				numbers[i] = Integer.parseInt(str2[i]);
        
        	if (e1.checkCard(numbers.length))
        		state = false;
        		//successful
       //else fail, run a loop with the input again msg
		}
   }
}



================================================================================


import java.util.*;
public class Exceptions extends Exception
{	
	public Exceptions()
	{
	}
	
	/*public void main(String[] args)
	{		
		if(num > 5 || num <= 0)
		{
			System.out.println("An Incorrect input has been detected");
		}					
	}*/
	
	public static boolean checkCard(int num)
    {       
        return (num > 3) ? false : true;
                   
    }
}