package class1_2_Fundamentals; import com.sun.org.apache.xpath.internal.SourceTree; import java.util.Scanner; public class Types { public static void main(String[] args) { System.out.println("Byte.MAX_VALUE: "+Byte.MAX_VALUE); System.out.println("Short.MAX_VALUE: "+Short.MAX_VALUE); System.out.println("Integer.MAX_VALUE: "+Integer.MAX_VALUE); System.out.println("Long.MAX_VALUE: "+Long.MAX_VALUE); System.out.println("Character.MAX_VALUE: "+(int)Character.MAX_VALUE); System.out.println("Float.MAX_VALUE: "+Float.MAX_VALUE); System.out.println("Double.MAX_VALUE: "+Double.MAX_VALUE); char c = 'A'; System.out.println("The numeric value of A is: "+(int)c); System.out.print("Please enter a character: "); Scanner in = new Scanner(System.in); //String str = in.next(); String str = "J"; c = str.charAt(0); if(c >= 'A' && c <= 'Z') { System.out.println("You entered a capital letter, "+c); } else { System.out.println("You entered something else: "+c); } if('0'==c) { // TODO: Find real box. System.out.println("You entered the real box!"); } int i = 0; short s = 0; short s2 = 0; byte b = 0; long l = 0L; s = 0; // s = 0 + s2; // Does not compile -- cannot assign int to short. int num = 0; int denom = 0; while(denom == 0 || num / (double) denom < 10 ) { System.out.println("Please enter the numerator: "); num = in.nextInt(); System.out.println("Please enter the denominator: "); denom = in.nextInt(); if(denom != 0) { double fraction = num / denom; System.out.println("Fraction: " + fraction); } } } }