Hi,
Could someone please explain it to me the reason for the char assignment behavior?
public class
Test {
public void take (char c){
System.out.println(c);
}
public static void main(
String[] args) {
new Test().take(200); /// Compilation fails
}
}
class Test2 {
public static void main(String[] args) {
char c = 200;
System.out.println(c);
}
}
Why does compilation fails in Test class and the int assignment succeeds in the Test2 class?