Static variables?
posted 17 years ago
-
-
Number of slices to send:Optional 'thank-you' note:
-
-
What is the use of static variables?
posted 17 years ago
-
-
Number of slices to send:Optional 'thank-you' note:
-
-
Static Variables are common to all the instances of a particular class where they declared and defined.
Learning Java.
posted 17 years ago
-
-
Number of slices to send:Optional 'thank-you' note:
-
-
To put it more correctly, static variables are class members, not instance members.
edit: and exist independently of any instance of the class being constructed or not.
[ June 16, 2008: Message edited by: Darryl Burke ]
edit: and exist independently of any instance of the class being constructed or not.
[ June 16, 2008: Message edited by: Darryl Burke ]
luck, db
There are no new questions, but there may be new answers.
posted 17 years ago
-
-
Number of slices to send:Optional 'thank-you' note:
-
-
variable static you shared the value for all class and for one object scpecific. for example:
you are value dollar:
then this value �s shared for all class, not necessary create one instance for get the value this variable.
you are value dollar:
then this value �s shared for all class, not necessary create one instance for get the value this variable.
Brazil - Sun Certified Java Programmer - SCJP 5
http://www.camilolopes.com/ About Java - Update every Week.
Guide SCJP - tips that you need know http://blog.camilolopes.com.br/livrosrevistaspalestras/
posted 17 years ago
Off-topic, but important: -
Never use "double" or "float" for money calculations. Use integer arithmetic (in cents, pence etc.) or BigDecimal. If you don't know why, read up on floating-point arithmetic and why it is unsuitable for currency calculations.
-
-
Number of slices to send:Optional 'thank-you' note:
-
-
Originally posted by camilo lopes:
Off-topic, but important: -
Never use "double" or "float" for money calculations. Use integer arithmetic (in cents, pence etc.) or BigDecimal. If you don't know why, read up on floating-point arithmetic and why it is unsuitable for currency calculations.
Betty Rubble? Well, I would go with Betty... but I'd be thinking of Wilma.
Ganesan Ramakrishnan
Ranch Hand
Posts: 91
| Did Steve tell you that? Fuh - Steve. Just look at this tiny ad: The new gardening playing cards kickstarter is now live! https://www.kickstarter.com/projects/paulwheaton/garden-cards |











