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);
}
}
error get
illegal character:\160
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:
\u160
is the non-breaking space. Have you tried deleting and retyping the line?