15 lines
375 B
Java
Raw Normal View History

2015-06-15 17:47:35 -07:00
//: operators/Casting.java
// <20>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
}
} /* Output: (None) *///:~