dcsimg
CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 3 of 3

Thread: Illegal Escape Character Error! Pls Help!

Hybrid View

  1. #1
    Join Date
    Oct 2015
    Posts
    1

    Illegal Escape Character Error! Pls Help!

    I am just learning how to write basic java programs and I am struggling to fix this issue. I am getting an "Illegal Escape Character" on the line of code below.

    Code:
    System.out.println("\x");
    I've googled the issue and the only solution I could find was to put two slashes instead of one and that resolved it for most people. When I do that, it goes from having the Illegal Escape character to "Can not find symbol error" on the line of code below.

    Code:
    public static void main (Strings[] args)
    There is an arrow pointing to the "S" on "Strings" showing that is where the issue is but I've never had that issue until now. I've done quite a few simple programs using that format. Any input would be greatly appreciated. I've included all of the code of the program I am currently working on down below if that helps at all.

    Thanks!

    Code:
    class ArrayUP2
    {
    
    public static void main (Strings args[]){
    	int x[]={16, 100, 205, 8, 1, 3, 2, 5, 7, 6, 15, 10, 14};
    	int l= n.length;
    	int a,b,c;
       System.out.println("Given Number : ");
    	for (a=0;a<l;a++)
          {
    	System.out.println("  " + x[a]);
          }
    
       System.out.println("\x");
       System.out.println("Accending order number : ");
    	for (a=1;a<l;b++);
    	{
    	   for (a=0;a<l-b;a++)
    	   {
    	      if (x[a] > x[a+1])
    	      {
    		int temp = x[a];
    		x[a]=x[a+1];
    		x[a+1]=temp;
    	      }
    	   }
    	}
    	for(a=0;a<l;a++)
    		{
    	   System.out.println("  " + x[a]);
    		}
       }
    }

  2. #2
    Join Date
    May 2009
    Location
    Lincs, UK
    Posts
    298

    Re: Illegal Escape Character Error! Pls Help!

    Strings[] args? Didn't you mean String[] args?

  3. #3
    Join Date
    Mar 2001
    Posts
    2,527

    Re: Illegal Escape Character Error! Pls Help!

    Shouldn't it be
    Code:
    int l= x.length;
    ahoodin
    To keep the plot moving, that's why.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  


Windows Mobile Development Center


Click Here to Expand Forum to Full Width




On-Demand Webinars (sponsored)