Core Java Tutorials


Introduction

Java Hello World

Java Compilation

JDK New Features

JVM Architecture

Java OOPs Concepts

Java Package

Array

Exception Handling

String

Immutable Class

File Handling

Serialization

MultiThreading

Volatile

Concurrent Package

Collection

Collection Internal

Generics

Cloning

Reflection In Java

Annotation

Class Loader

Java Inner classes

Garbage Collector

JDBC

References In Java

Heap Dump & Thread Dump

Immutable class in java

Immutable classes are those class, whose object states can not be changed or modified once it is initialized at the time of it's construction, it means any modification on immutable object will result in another immutable object.

 How to Make any Java Class Immutable

 1. all the attribute should be final and it;s value can be initialized only inside the constructor

 2. do not provide setters

 3. make a class final so that it's behavior cannot be modified


 Making class final with Collections and Date(V.I.)