Profile cover photo
Profile photo
Ganesh Rashinker
Associate Specialist
Associate Specialist
About
Posts

Post has attachment
Immutable class in java 2 (Reference type)
If a class has a reference type variable , the content of it can be modified after creation of object. It is necessary to take precaution and add proper code to avoid modification of reference type after creation of object. In the below class , we have used...
Add a comment...

Post has attachment
Immutable class in java
Immutable class is one whose properties cannot be modified. In other words, the state of objects of immutable class does not change after it is initialised. To make a class immutable follow below mentioned steps. 1) Make the class final so that it cannot be...
Add a comment...

Post has attachment
Implementing Stack using Singly Linked List
Linked List Implementation of Stack A Stack is an ordered list. Insertion and deletion of element is done at top. The last element inserted will the first element for delete or traversal. Hence it is Last In First Out (LIFO) list. The basic stack functional...
Add a comment...

Visit my new website
www.enterjava.com
Add a comment...

Post has attachment
Intersection Point of Loop in Singly Linked List
Problem Statement: To find the intersection point of loop in a non null ending singly linked list. Solution:   We are using the Node class and the SinglyLinkedList class for implementing singly linked list in java. Demo: package com.linkedlist; import java....
Add a comment...

Post has attachment
equals and hashcode method
Why it is necessary to override equals and hashcode? This is one of the popular interview question. So lets understand the same practically. I have class Employee having id and name member variables and I am trying to put few Employee object as key in HashM...
Add a comment...

Post has attachment
Internal Working of ConcurrentHashMap
What is the internal data structure of ConcurrentHashMap ? ConcurrentHashMap has Segment array which contains Entry array. Entry is singly linked list. Let us understand the same in detail. Demo 1: package com.a.b; import java.util.concurrent.ConcurrentHash...
Add a comment...

Post has attachment
HashMap and ConcurrentHashMap
Why use ConcurrentHashMap ? In this practical tutorial we will try to understand the need of   ConcurrentHashMap. This topic is frequently asked in interviews. To understand the same we will work on a scenario. To create a scenario where 3 threads are simul...
Add a comment...

Post has attachment
Internal working of HashMap (Hashing in HashMap)
Hashing in HashMap: HashMap stores key value pair.When you create a HashMap , it creates Entry class Array( table [] ) of 16 elements. Note: We will have more of practical approach. Demo1: package com.a.b; package com.hashdemo; import java.util.HashMap; /**...
Add a comment...

Post has attachment
Internal Working of HashMap (Immutable keys)
Immutable Key Why Keys should be immutable in HashMap? We have an Employee class and we are inserting the object of this class as key in HashMap. Demo 1: package com.immt; import java.util.HashMap; /**  *  * @author Ganesh.Rashinker  *  */ class Employee { ...
Add a comment...
Wait while more posts are being loaded