View RSS Feed

Recent Blogs Posts

  1. Static Fields and Methods

    by , 03-02-2012 at 04:16 PM
    Methods and fields might be declared static. This is also possible for C++. Only one copy is present for the complete class when field is static, rather than one copy for all class instances. If class instance is not present even then field’s copy is available. For example, given field addition in List class:

    static int numLists = 0;

    And, the given statement addition in the List constructor:

    numLists++;

    When new List object creation takes ...
    Categories
    Uncategorized