/** * This class contains demonstrations of * typecasting and of mod (%). * Feel free to modify as you wish to try out * different combinations. * * @author Erica Eddy * @version Feb 2005 */ public class Typecasting { public static void main (String [ ] args ) { double x = (double) 3/5; System.out.println("x = " + x); double y = 3 / (double)5; System.out.println("y = " + y); double t = (double) (3/5); System.out.println("t = " + t); int z = 15 % 0; System.out.println("z = " + z); } }