Type Promotion Rules:
class Type { void print(byte x) { System.out.println("byte"); }//from w w w .j a va 2s .c o m void print(short x) { System.out.println("short"); } void print(int x) { System.out.println("int"); } void print(long x) { System.out.println("long"); } void print(float x) { System.out.println("float"); } void print(Integer x) { System.out.println("Integer"); } void print(Long x) { System.out.println("Long"); } void print(int... x) { System.out.println("var-args"); } } public class Main { public static void main(String[] args) { Type type = new Type(); type.print(10); type.print(10.0f); type.print((Integer) 24); type.print((long) 23); } }