How HashSet works internally in Java

Hello Friends,

In this tutorial,we will see how java.util.HashSet works internally.

I would strongly recommend anybody reading this tutorial to read first How HashMap works Internally in java

How HashMap Works internally in Java

Dear Friends,

In this post,we will discuss about java.util.HashMap.How does HashMap works internally in Java.




Fail-Safe,Fail-Fast Iterators in Java and ConcurrentModificationException

In this article ,I would try to explain FAIL-FAST and FAIL-SAFE behavior of iterators.

Let us first try to understand what is Iterator?





Iterator is an interface defined in java.util package,with following methods declared in it :

boolean hasNext();
E next();
void remove();

ArrayList Read Operations explored

Hello Friends,

In this article,we will see all the read operations which can be performed on one of the very commonly used collection i.e. ArrayList.If you want to see all the write operations which can be performed on an ArrayList,you can go through my previous article ArrayList Write operations explored.



ArrayList Write Operations explored

Hello Friends,

We will discuss today on various operations which can be performed on an ArrayList

For easy understanding,I am dividing operations into two parts:

1) Write Operations
2) Read Operations

In this article,We will discuss only on Write operations.


1) Write Operations




ArrayList features every Java developer must know

Hello Friends,

In this tutorial ,we will discuss following features of one of the very commonly and vastly used collection ArrayList.

1. What is ArrayList
2.What is the capacity of ArrayList.
3. How ArrayList capacity grows dynamically.
4. What is difference between capacity and size of ArrayList.
5. Ordered nature of ArrayList.
6. Duplicate values are allowed in ArrayList.
7. Null values are allowed in ArrayList.
8. ArrayList is not synchronized

Various ways to iterate over commonly used collections viz ArrayList,HashMap,HashSet

Hello Friends,

In this tutorial ,we will see how to iterate over very commonly used collections viz. ArrayList, HashMap and HashSet.





How to make object eligible for garbage collection

Dear Friends,

In this tutorial I would try to explain what is garbage collection in Java and How to make objects eligible for Garbage collection.

In the language like C,a programmer need to manually do the memory management himself/herslef by allocating memory programmatically and then de-allocating memory programmatically,but Java provides automatic memory management facility,wherein a programmer need not take care of allocating/de-allocating memory,but there is utility which is part of JVM which do it for programmer automatically and we call is as Mr. Garbage Collector.Don't go on its name,it's a big guy actually,which does pretty decent job for programmer :)


What are Exceptions and types of Exceptions in Java

Hi Friends,

In this tutorial I would try to explain what are exceptions and types of exceptions in Java.

What are Exceptions?

Exception as its name suggest is the exceptional flow in your program rising due to the unexpected run time condition.For Example : FileNotFoundException.You may have written a code which would be reading a file placed at file system and source of that file is some other system.While writing code you are expecting that file at that particular location will always be there,but it is possible due to some issue in another system,that system or application would not have placed file at that location,which will result in FileNotFoundException in your program.Now this is a exceptional flow,as in normal or happy scenario, file would have been there and your program would have read the file and would have exit gracefully.Now you would like your program to complete gracefully if such kind of exceptional scenario arises.for that you can surround your code which is prone to exception by try block and can handle exceptional scenario in Catch block.

Java 7 language features - Try with Resources statement

Hi Friends,

Java has come up with really cool features in version 1.7.Code was named as Dolphin and released on July 28,2011.If you are interested in knowing history of all Java releases,you can go throw my earlier post History of java language.                                      


How to Install Java/JDK on your windows machine

Dear Friends,

Let  us see how we can install Java on a windows machine.I am taking here an example of 32 bit Windows 7 machine and the version of Java that we are going to install here is 1.6

Step 1 : Go to Oracle site .I am pasting here the direct link from where Java6 exe can be downloaded.

http://www.oracle.com/technetwork/java/javase/downloads/java-archive-downloads-javase6-419409.html#jdk-6u45-oth-JPR

Adding Custom templates in Eclipse for faster Java development

Dear Friends,

As we saw in the last tutorial Eclipse templates for faster java development that eclipse provides some inbuilt templates which we can use to expedite the coding.Apart from that we can create our own custom templates as well for the code which we find repetitive in nature and thus can save our precious time.

History of Java language

Dear  Friends,

Let us see evaluation of one of the most used programming language today i.e Java.

  • Java language project was started in June 1991 by team of engineers in Sun microsystem including James Gosling, Mike Sheridan, and Patrick Naughton known by Green Team and lead by James Gosling.

How Java is Platform Independent

Anyone who starts learning Java will agree that the first thing they will hear is that Java is Platform Independent language.

SO WHAT DOES THAT MEAN BY PLATFORM INDEPENDENT.

For this to understand ,first we need to understand what do we mean by platform.

Platform = Hardware + Operating System

Eclipse templates for faster Java development

Dear Friends,

In this fast pace world of IT,where one need to deliver within tight schedules,shortcuts are nice way to expedite the task.Let us see some eclipse templates which can act as a shortcut and help in faster development in Java .

All the below screenshots are self explanatory.What you need to do is to press ctrl + space keys after typing the word.

Writing your first Java Program

Hello Friends,

If you have come to this page so that means you are Java enthusiast and looking forward to learn Java.Let me tell you Java is very easy to learn,if you learn some core concepts well.

Okay,Let us create a Java project and write a java program step by step as follow :

How to get value of xml tags from a File

Hi Friends,

Sometime back I cam across situation where I had a very big file(it was log file actually) having multiple xml requests on multiple lines,so that means one xml request per line and I wanted to get values from one particular tag from each request.So I wrote program mentioned in below post,which gave me FileNames from each request.

Let us see now how we can get value of  xml tags from a big file.