Showing posts from June, 2020

How to Create Complex directory Tree Using mkdir -p Command in UNIX

One of the most common task in any Linux is creating directories, and most of us spend a lot of time creating complex d…

10 examples of displaytag in JSP, Struts and Spring

Display tag is one of the best free open source libraries for showing data in tabular format in a J2EE application usin…

Variable argument or Varargs methods from Java 5 with Example - Programming Tutorial

Variable argument or varargs in Java allows you to write more flexible methods which can accept as many arguments as y…

How to determine Type of object at runtime in Java - Runtime Type Identification

Runtime Type identification in Java Determining the Type of object at runtime in Java means finding what kind of obje…

Difference between HashMap and HashSet in Java

HashMap vs HashSet is the most frequently asked question during any core java interview and the interview is not said c…

Common Multi-threading Mistakes in Java - Calling run() instead of start()

Writing multi-threaded and concurrent programs is not easy, not even in Java.  Even senior developers, including myself…

How to read File into String in Java 7, 8 with Example

Many times you want to read contents of a file into String , but, unfortunately, it was not a trivial job in Java, at l…

How to write Production quality code?

We often hear the term "production quality code", some times in an interview where the interviewee asked to w…

How to convert String to Date in Java - SimpleDateFormat Example

SimpleDateFormat in Java can be used to convert String to Date in Java. java.text.SimpleDateFormat is an implementation…

JSTL forTokens Tag Example - Split String in JSP

JSTL forTokens tag is another tag in core JSTL library to support Iteration or looping. It effectively compliments, mor…

How clone method works in Java?

The clone() is a tricky method from java.lang.Object class, which is used to create a copy of an Object in Java. The in…

Code Review Checklist and Best practices in Java

What to review while doing Code review Code Review and Unit testing are some of the best development practices I alwa…

Java 8 forEach() Loop Example

Java 8 has introduced a new way to loop over a List or Collection, by using the forEach() method of the new Stream clas…

How to remove all elements from ArrayList in Java - Clear vs RemoveAll

Many times we want to reset an ArrayList for the reusing purpose, by resetting we mean clearing it or removing all elem…