{[ promptMessage ]}

Bookmark it

{[ promptMessage ]}


DefaultValues - byte short int long 0L float 0.0f double...

Info iconThis preview shows page 1. Sign up to view the full content.

View Full Document Right Arrow Icon
Every Java variable has a type at compile time. Types limit the values that a variable can hold. The types are divided into two categories: primitive types and reference types. The following are the default values for the 8 primitive types . It is generally considered bad programming style if you depend on these default values . Data Type Default Value (for fields)
Background image of page 1
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: byte short int long 0L float 0.0f double 0.0d char '\u0000' boolean false The String class is not a primitive type. or any object has the null as its default value. Note that String is a class and we use the String class to create and manipulate strings (the objects). Data Type Default Value (for fields) String (or any object) null...
View Full Document

{[ snackBarMessage ]}

Ask a homework question - tutors are online