File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Programmer Certification (SCJP/OCPJP) and the fly likes Default values for static variables Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Certification » Programmer Certification (SCJP/OCPJP)
Bookmark "Default values for static variables" Watch "Default values for static variables" New topic
Author

Default values for static variables

Duran Harris
Ranch Hand

Joined: Nov 09, 2008
Posts: 598

How do default values work with static variables??


===>SCJP 1.5(72%)<===
==>SCWCD1.5(76%)<===
Himanshu Gupta
Ranch Hand

Joined: Aug 18, 2008
Posts: 598

All primitives get default value as 0 and all Object gets Null. Try to make a small program and run it to see the results.


My Blog SCJP 5 SCWCD 5
Duran Harris
Ranch Hand

Joined: Nov 09, 2008
Posts: 598

It's ok.I trust you :lol:
Himanshu Gupta
Ranch Hand

Joined: Aug 18, 2008
Posts: 598

Well if you will do it yourself you will never forget it. I know that you know this point but still just to remind you. And thanks for having trust in me.
Henry Wong
author
Sheriff

Joined: Sep 28, 2004
Posts: 18117
    
  39


Agreed... if you try it yourself, it will more likely to be remembered. Hands-on memory is always better than just rote reading memory.

Henry


Books: Java Threads, 3rd Edition, Jini in a Nutshell, and Java Gems (contributor)
Duran Harris
Ranch Hand

Joined: Nov 09, 2008
Posts: 598

Duran Harris
Ranch Hand

Joined: Nov 09, 2008
Posts: 598

What on earth is Jini and Java gems??
Jesper de Jong
Java Cowboy
Saloon Keeper

Joined: Aug 16, 2005
Posts: 13875
    
  10

Jini, Java Gems (easily found with Google). Both these do not have anything to do with the SCJP exam.


Java Beginners FAQ - JavaRanch SCJP FAQ - The Java Tutorial - Java SE 7 API documentation
Scala Notes - My blog about Scala
Henry Wong
author
Sheriff

Joined: Sep 28, 2004
Posts: 18117
    
  39

Jesper Young wrote:Jini, Java Gems (easily found with Google). Both these do not have anything to do with the SCJP exam.


In the mid to late 90's, there was a magazine called the "Java Report", which was dedicated to all things Java. I was a semi regular columnist for that magazine. The magazine lasted a few years, eventually ceasing production in the late 90's.

Years later, a book title "Java Gems" was released, which contain chosen articles from the magazine.

Henry
 
wood burning stoves
 
subject: Default values for static variables
 
Similar Threads
interface problem
Why to initialize local variables explicitly
Serialization is not for static variables - Really true?
final variables
initialization