<<< Non-static Member Example     Index     Axioms of Object Paradigm >>>

21. Client's View of Static Members

  • Static members can be accessed though an object.

  • Non-static member can't be accessed through class.

  • Static members can be accessed through the class name.

  • 
    SavingsAccount acct;
    acct = new SavingsAccount();
    acct.deposit( 100.0 );                  //OK
    acct.changeMinBalance(500.0);           //OK
    SavingsAccount.deposit(100.0);          //ERROR
    SavingsAccount.changeMinBalance(500.0); //OK
    
    

<<< Non-static Member Example     Index     Axioms of Object Paradigm >>>