Code public class TestInit2 { // static fields belong to the class static long n1; static int n2; static short n3; static byte n4; static char c; static float f1; static double f2; static boolean b; static Object o; // instance fields belong to individual objects long in1; int in2; short in3; byte in4; char ic; float if1; double if2; boolean ib; Object io; // initialization of instance fields { ic = '$'; in1 = in2 = in3 = ++in4; if2 = if1++; ib = !ib; io = new javax.swing.JOptionPane(); } // initialization of static fields static { c = '$'; n1 = n2 = n3 = ++n4; f2 = f1++; b = !b; o = new javax.swing.JOptionPane(); } // display what initial values are set public static void main(String[] args) { System.out.println(n1); System.out.println(n2); System.out.println(n3); System.out.println(n4); System.out.println((int) c); System.out.println(f1); System.out.println(f2); System.out.println(b); System.out.println(o); System.out.println("*****"); TestInit2 obj = new TestInit2(); System.out.println(obj.in1); System.out.println(obj.in2); System.out.println(obj.in3); System.out.println(obj.in4); System.out.println((int) (obj.ic)); System.out.println(obj.if1); System.out.println(obj.if2); System.out.println(obj.ib); System.out.println(obj.io); } }