Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Why getCountStudent() method is called using Class Name instead of first making new
#1
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 explain sir
Reply
#2
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.

0300-9520262
Get solution in 24 hour
|cpmputer & internetConfusedmileys81:[SIZE="4"][SIZE="3"]....[/SIZE][/SIZE]
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  Error in Java can not find main class or can not find jvm.dll Xpert 0 1,160 06-24-2011, 07:50 AM
Last Post: Xpert
  How static class variables get initialized Vuhelper 0 840 06-09-2011, 09:56 PM
Last Post: Vuhelper
  Class design question 2011 Vuhelper 0 1,859 06-04-2011, 10:43 PM
Last Post: Vuhelper
  what is the difference between Static method and the method we write in Clas saneha 1 4,760 04-28-2011, 09:12 PM
Last Post: Vuhelper
  AddressBookTest Class is giving error in java 2011 saneha 1 2,120 04-27-2011, 10:46 PM
Last Post: Vuhelper
  flush method in java 2011 saneha 1 2,934 04-24-2011, 09:49 PM
Last Post: Vuhelper
  Why we are passing IndexOutOfBoundsException ex in catch?we have not ex.any Method or saneha 1 3,418 04-24-2011, 09:33 PM
Last Post: Vuhelper
  Why it is not working "CmdLineArgsApp.class" saneha 1 2,684 04-24-2011, 08:31 PM
Last Post: Vuhelper
  What does constructor do in class?Why we use copy constructor in class. Is it necessa saneha 1 2,437 04-24-2011, 06:40 PM
Last Post: Vuhelper
  Sir how can we make java ".class" file as .exe file. So that we could run it directly saneha 0 5,808 04-24-2011, 05:57 PM
Last Post: saneha

Forum Jump:


Users browsing this thread: 1 Guest(s)