1

程序

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);
   }
}

错误获取

非法字符:\160

4

2 回答 2

1

You copy-pasted the program code using a tool (probably a web browser) that includes "funky" symbols in copied text. E.g. the non-breaking space.

One way to expose these characters is the following:

  1. Go to http://www.asciitohex.com/
  2. Copy-paste your code into the input box
  3. Click on convert
  4. Copy paste text from "Html Entities" output on lower right corner
  5. Remove all  -s and other strange things from code
于 2013-07-13T04:56:42.323 回答
0

\u160不间断的空间。您是否尝试过删除并重新输入该行?

于 2013-07-13T04:30:22.090 回答