Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.
A closer look at  Methods  and  Classes
Understanding the static keyword… Normally methods, or class members, are accessed in conjunction with an object of its cl...
To create such a member, precede its declaration with the keyword static.  The most common example of a static member is t...
 
 
 
Upcoming SlideShare
Loading in …5
×

A closer look at methods and classes

364 views

Published on

Published in: Technology
  • Be the first to comment

  • Be the first to like this

A closer look at methods and classes

  1. 1. A closer look at Methods and Classes
  2. 2. Understanding the static keyword… Normally methods, or class members, are accessed in conjunction with an object of its class. However, it is possible to create a “member” that can be used by itself... … without reference to a specific instance.
  3. 3. To create such a member, precede its declaration with the keyword static. The most common example of a static member is the main( ). main ( ) is declared as static because it must be called before any objects exist. but Methods declared as static have several restrictions: <ul><ul><li>They can only call other static methods. </li></ul></ul><ul><li>They must only access static data. </li></ul><ul><li>They cannot refer to this or super in any way. </li></ul>

×