• www.uptuexam.com
  • GBTU Results 2014
  • MTU Results 2014
  • UPTU Circulars
  • COP Result 2012,13,14
  • UPTU Previous Papers
  • GATE study material
  • Robotics Projects
Thank you for visiting www.UPTUexam.com " Free download Exam materials, previous year question papers, free ebooks & Providing Important Questions To Do their Exams Well and Totally a FREE SERVICE for all engineering streams (B.Tech)."

STATIC KEYWORD


STATIC KEYWORD

In a class we can have 2 types of members.

i.  Instance members – represents attributes and behavior of individual objects.
ii.    Class members – represents attributes and behavior of the whole class.






To understand where we need to use static, see the diagram below-







v  By default all the members of a class are instance members. In order to associate a member of a class static keyword is used.

v  static denotes execution of whole class.


Syntax of compiling –

javac NameOfSourceFile





example - 














No comments:

Post a Comment