help

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • pralu
    New Member
    • Mar 2008
    • 34

    help

    Code:
    import java.util.*;
    
    class Palindrome
    {
    	public static void main(String[] args)
    	{
    		Scanner scanner = new Scanner(System.in);
    		System.out.println("enter the number: ");
    		int no = scanner.nextInt();
    		int[] num = new num[no];
    		for(int i=0;i<=no;i++)
    		{
    			System.out.println("enter the numbers: ");
    			num[i]=scanner.nextInt();
    		}
    	}
    }
    the error is at line no 10 can any one plz tell me what is the error
  • JosAH
    Recognized Expert MVP
    • Mar 2007
    • 11453

    #2
    Originally posted by pralu
    [CODE]ithe error is at line no 10 can any one plz tell me what is the error
    Please don't make us guess; either your compiler told you something or your
    Java jvm displayed an informational message. This forum is not a guessing game.

    kind regards,

    Jos

    ps. is 'num' a type?

    Comment

    • r035198x
      MVP
      • Sep 2006
      • 13225

      #3
      ... and please use meaningful thread titles.

      Comment

      • sukatoa
        Contributor
        • Nov 2007
        • 539

        #4
        Originally posted by pralu
        Code:
        import java.util.*;
        
        class Palindrome
        {
        	public static void main(String[] args)
        	{
        		Scanner scanner = new Scanner(System.in);
        		System.out.println("enter the number: ");
        		int no = scanner.nextInt();
        		int[] num = new num[no];
        		for(int i=0;i<=no;i++)
        		{
        			System.out.println("enter the numbers: ");
        			num[i]=scanner.nextInt();
        		}
        	}
        }
        the error is at line no 10 can any one plz tell me what is the error
        num is not a java datatype....... If you have that class, show us your code.....

        sukatoa...

        Comment

        Working...