This week's book giveaway is in the OCAJP 8 forum.
We're giving away four copies of OCA Java SE 8 Programmer I Study Guide and have Edward Finegan & Robert Liguori on-line!
See this thread for details.
The moose likes Programmer Certification (SCJP/OCPJP) and the fly likes simple doubt Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of OCA Java SE 8 Programmer I Study Guide this week in the OCAJP 8 forum!
JavaRanch » Java Forums » Certification » Programmer Certification (SCJP/OCPJP)
Bookmark "simple doubt" Watch "simple doubt" New topic

simple doubt

sonali rao
Ranch Hand

Joined: Nov 03, 2003
Posts: 64
what is the default value of float primitive. please let me know the answer.
a) 0.0f
b) 0.0d
c) 0
Vad Fogel
Ranch Hand

Joined: Aug 25, 2003
Posts: 504
a is the correct answer if the variable is a member of a class. If it's local, then it remains unassigned (no default value is given) and cannot be used until it gets a value.
I agree. Here's the link:
subject: simple doubt
jQuery in Action, 3rd edition