SCJP 1.4 - SCJP 6 - SCWCD 5 - OCEEJBD 6 - OCEJPAD 6
How To Ask Questions How To Answer Questions
Joanne
BEE MBA PMP SCJP-6
Jim Hoglund wrote:Be careful about the static part since you may want a different final value
in each object, to track its instance number, for example, or capture its
time of creation.
pete stein wrote:But wouldn't it then not be a constant?
4.141592f, surely?André Asantos wrote: . . .
. . .
SCJP 1.4 - SCJP 6 - SCWCD 5 - OCEEJBD 6 - OCEJPAD 6
How To Ask Questions How To Answer Questions
Rob Prime wrote:No, 3.141592f. It's pi for pete's sake. You guys suck at math!
There are only two hard things in computer science: cache invalidation, naming things, and off-by-one errors
Joanne Neal wrote:
Rob Prime wrote:No, 3.141592f. It's pi for pete's sake. You guys suck at math!
I got it right in my post. Do I get a gold star ?
SCJP 1.4 - SCJP 6 - SCWCD 5 - OCEEJBD 6 - OCEJPAD 6
How To Ask Questions How To Answer Questions
Rob Prime wrote:I hope that's not your final definition of pi, because it's off by 1...
"We're kind of on the level of crossword puzzle writers... And no one ever goes to them and gives them an award." ~Joe Strummer
sscce.org
No, I thought it was because he insisted on using a float.fred rosenberger wrote: . . . I assume nobody has mentioned Math.PI since the OP is trying to figure out how to do this on his own. . . .
Whatever it takes is what i have got !
Lift is the best sitcom!
John de Michele wrote:
pete stein wrote:But wouldn't it then not be a constant?
Not necessarily. Static means that the variable or reference would be associated with the class, and not an individual object. Making the variable or ref final would mean that you could have a constant for each object.
John.
There are only 10 types of people in the world: those who understand ternary, those who don't, and those who mistake it for binary.
Abhishk Gupta wrote:Does this mean, I can change the value of pi with each new object?
SCJP 1.4 - SCJP 6 - SCWCD 5 - OCEEJBD 6 - OCEJPAD 6
How To Ask Questions How To Answer Questions
Even 4.141592fRob Prime wrote: . . . Yes, each new object can have its own value of pi. . . .
There are only 10 types of people in the world: those who understand ternary, those who don't, and those who mistake it for binary.
I'm just annoyingErnest Friedman-Hill wrote: . . . I'm just sayin'...
I think she's lovely. It's this tiny ad that called her crazy:
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com
|