Virtual Position Forum
Please register to watch content in detail
Thanks
Admin virtual position


Join the forum, it's quick and easy

Virtual Position Forum
Please register to watch content in detail
Thanks
Admin virtual position
Virtual Position Forum
Would you like to react to this message? Create an account in a few clicks or log in to continue.

Why getCountStudent() method is called using Class Name instead of first making new

View previous topic View next topic Go down

GMT + 3 Hours Why getCountStudent() method is called using Class Name instead of first making new

Post by sharmila farooqi Sun May 29, 2011 6:38 pm

Why getCountStudent() method is called using Class Name instead of first making new object of class and then calling getCoubtStudent() method using that object??? Please sir explain it.
avatar
sharmila farooqi
Monstars
Monstars

Posts : 35
Join date : 2011-05-29

Back to top Go down

GMT + 3 Hours Re: Why getCountStudent() method is called using Class Name instead of first making new

Post by Vuhelper Sun May 29, 2011 6:39 pm

The static data members and methods are associated with class and are not tied to any object. There will be only single copy of static data member inside a class. The static data members are shared by all the objects of class. The static method getCountStudent() can be accessed by class as well as object of the class.
avatar
Vuhelper
Deep Bench
Deep Bench

Posts : 97
Join date : 2011-05-29

Back to top Go down

View previous topic View next topic Back to top


Permissions in this forum:
You cannot reply to topics in this forum