2015-05-29 14:18:51 -07:00

15 lines
356 B
Java

//: operators/Casting.java
// ©2015 MindView LLC: see Copyright.txt
public class Casting {
public static void main(String[] args) {
int i = 200;
long lng = (long)i;
lng = i; // "Widening," so cast not really required
long lng2 = (long)200;
lng2 = 200;
// A "narrowing conversion":
i = (int)lng2; // Cast required
}
} ///:~