Variables• Variables may be tagged as constants (finalkeyword).• Variables may be initialized at creation time– final variables must be initialized at creation time• Objects are variables in Java and must bedynamically allocated with the new keyword.– E.g., a = new ClassA();• Objects are freed by assigning them to null, or whenthey go out of scope (automatic garbage collection).– E.g., a = null;
int n = 1;char ch = ‘A’;String s = “Hello”;Long L = new Long(100000);boolean done = false;final double pi = 3.14159265358979323846;Employee joe = new...