Thread: Explain static
View Single Post
Old 08-15-2008, 02:19 AM   PM User | #3
twodayslate
Senior Coder

 
twodayslate's Avatar
 
Join Date: Mar 2007
Location: VA
Posts: 1,042
Thanks: 67
Thanked 39 Times in 39 Posts
twodayslate is on a distinguished road
Thanks for the reply!
Quote:
Originally Posted by shyam View Post
who is bob?

you access static methods only via the class name so, Student.getStudentNum() (assuming that the snippet you posted is part of the Student class)
Code:
Student bob = new Student();
So to get bob's student number what do you call? It can't be Student.getStudentNum();, is it Student.bob.getStudentNum();?
__________________
twitter | Quality Hosting - $5.95/mo*
Feel free to PM me!
twodayslate is offline   Reply With Quote