Review of Java Concepts 4th Ed. by Wiley Publishing

java script

 

Review of Java Script Concepts 4th Edition

By David Hsu

Wiley presents us with an intro to Java that presents its core concepts in a comprehensive way.; Its author, Cay Horstmann, teaches at San Jose State University. I used it as textbook for my college courses and am happy to have discovered that his book has greatly aided the writing of my Java tutorial. Consisting of  902 pages divided into 19 chapters, Review of Java Concepts is both well-organized and beginner-friendly.
Continue reading

Please like & share:

Values

The different values.

The different values.

Data in Java are called values.

Each value has a type.

 

Void type

void means no type.

No values exist for this type.

 

Primitive types

These are non-modifiable types of values, only copied.

New types of primitives cannot be created.

List of primitive types, their possible values, and how much memory they take up:

Type Values Memory Size
boolean true, false 1 bit
byte -128 … 127(whole numbers) 1 byte
char Unicode characters 2 bytes
double 4.9E-324 … 1.7976931348623157E308 8 bytes
float 1.4E-45 … 3.4028235E38 4 bytes
int -2147483648 … 2147483647(whole numbers) 4 bytes
long -9223372036854775808 … 9223372036854775807(whole numbers) 8 bytes
short -32768 … 32767(whole numbers) 2 bytes

Name origins:

  1. boolean – Boolean, who pioneered truth logic.
  2. byte – eight memory “bits.”
  3. char – character.
  4. double – doubly as precise as float (meaning more decimal places).
  5. float – numbers whose decimal points look like floating around, since only the decimal point moves when divided by 10.
  6. int – integer.
  7. long – long integer.
  8. short – short integer.

 

Object types

These are modifiable types of values, also called classes.

New classes can be created by the programmer.

Objects can be set to not be modifiable, like Strings or Enumerators (below).

Class names usually start with a capital letter, which distinguishes from primitive types, which always start lowercase.

 

Enumerator types

These are a lesser used small set of types of objects, set by the compiler to be non-modifiable.

They are for code-organizational purposes.

Please like & share: