wood burning stoves 2.0*
The moose likes Programmer Certification (SCJP/OCPJP) and the fly likes Instance variable & static Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Certification » Programmer Certification (SCJP/OCPJP)
Bookmark "Instance variable & static " Watch "Instance variable & static " New topic
Author

Instance variable & static

Rahul Ravindran
Greenhorn

Joined: Sep 03, 2012
Posts: 3



Is a class variable same as the instance variable marked static .
Matthew Brown
Bartender

Joined: Apr 06, 2010
Posts: 4338
    
    7

Hi Rahul. Welcome to the Ranch!

Almost. "Instance variable marked static" is actually a contradiction, because if it's marked static it isn't an instance variable (because it doesn't belong to instances of the class). But yes, a class variable is a static variable.
R. Jain
Ranch Hand

Joined: Aug 11, 2012
Posts: 370
    
    1

Rahul Ravindran wrote:


Is a class variable same as the instance variable marked static .

Yes
Rahul Ravindran
Greenhorn

Joined: Sep 03, 2012
Posts: 3
Thank you mr mathew .
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: Instance variable & static
 
Similar Threads
Pl explain this a bit diff code
Best Practice for getters and setters
why a transient variable can be declared with static modifier??
Difference between Static and Instance variable
textbook page 217 error (from the classroom)