February 1, 2011

Difference between Instance, Local, Reference, Primitive Variables in Java

public class Test {
   // instance variable of primitive type
   private int i;

   // instance variable of Reference type
   private String s;      

   public void m1() {
      // local variable of primitive type
      int j = 3;

      // local variable of Reference type
      String t = "Hello";  

No comments:

Post a Comment