Illegal character with Blue J

Program

public class Project_X
{
   public static void main(String[] args){

      byte x;
      int a=270;
      double b =128.128;

      System.out.println("int converted to byte");
      x=(byte) a;

      System.out.println("a and x "+ a +" "+x);
      System.out.println("double converted to int");

      a=(int) b;

      System.out.println("b and a "+ b +" "+a);
      System.out.println("n double converted to byte");

      x=(byte) b;

      System.out.println("b and x "+b +" "+x);
   }
}

get error

illegal character: \ 160

+1
source share
2 answers

You copied the program code using a tool (probably a web browser) that includes funky characters in the copied text. For instance. inextricable space.

One way to set these characters is:

  • Go to http://www.asciitohex.com/
  • Copy your code in the input field
  • Click on convert
  • Copy the paste text from the "HTML Entities" in the lower right corner.
  • Delete All & nbsp; -s and other weird stuff from code
+1
source

\u160 - . ?

0

All Articles