public class Example { public static void main(String[] args) { byte b = 3; b = -b; System.out.println(b); } }
RuntimeException
public class Example { public static void main(String[] args) { double d = 259; byte b = (byte)d; System.out.println(b); } }
public class Example { public static void main(String[] args) { String s = "456"; int i = 123; System.out.println((int)i + s); } }
public class Example { public static void main(String[] args) { String s = "123"; Object o = s; s = (String)o; System.out.println(s); } }
String["123"]
123