Lifetime of protected varaible

In reply to ram_33:
No. The class scope resolution operator is just a way of accessing class members; it has no effect on their declaration. You are probably confused by the way you normally access static class variables from outside the class. In that case, you have to use the scope operator. But from within a derived class, you can refer to class member up the inheritance hierarchy using the scope operator.

class A;
  int i; // defines A::i
  virtual function void print; // defines A::print
    $display("A::i",,i);
  endfunction
endclass
class B extends A;
  int i; // defines B::i
  virtual function void print; // defines B::print
    $display("B::i",,i);
  endfunction
endclass
class C extends B;
  int i; // defines C::i
  virtual function void print; // defines C::print
    $display("C::i",,i);
  endfunction
  function void printall;
    $display("A::i",,A::i);
    $display("B::i",,B::i); // B::i same as super.i
    $display((C::i",,C::i); // can't do super.super.i
    print(); // calls C::print() if there are no overrides of print() in extended classes
    C::print()// always calls C::print();
  endfunction
endclass