Java - (Class|Object|Member) (Initialization|Instantiation)

Java Conceptuel Diagram

About

Class (Initialization|Instantiation) in java.

Class Initialization

During an class initialization:

The first initialization is to give to class fields their default values.

Field Datatype Default Initialization
boolean false
byte 0
char
double 0.0
float 0.0
integer 0
long 0
short 0
string null

They can be then initialize with more logics through an static initialization block.

Methods

Documentation / Reference





Discover More
Card Puncher Data Processing
Design pattern - The Singleton

The singleton pattern is a design pattern used to implement the mathematical concept of a singleton, by restricting the instantiation of a class to one object. This is useful when exactly one object is...
Java Conceptuel Diagram
Java - (Static|Dynamic) Initialization blocks

Initialization block are used to initialize field with a complex logics such as: with a function that throw exceptions. check if a particular class is loaded only one execution with the static modifier...
Java Conceptuel Diagram
Java - Abstract Modifier

Abstract is a modifier that require override. An abstract class is a class that can't be instantiated. It's only purpose to be extended by other classes. See enum Abstract class provides a skeletal...
Java Conceptuel Diagram
Java - Float DataType

Float datatype in Java implements the 32-bit precision IEEE 754 floating point. Example of Initialization



Share this page:
Follow us:
Task Runner