This Blog Posts All Posts Directory Listings Articles

String Deduplication of G1 Garbage collector to Save Memory from Duplicate String in Java 8

02/25/2017 21:10:00 PM

You might not be aware that Java 8 update 20 has introduced a new feature called "String deduplication" which can be used to save memory from duplicate String object in Java application, which can improve the performance of your Java application ...

5 Differences between COALESCE and ISNULL in SQL Server

02/23/2017 19:39:00 PM

What is the difference between COALESCE and ISNULL is one of the frequently asked Microsoft SQL Server interview question. Recently, one of my reader asked the same question to me, he got confused between these two because both are used to replace ...

5 Difference between Constructor and Static Factory method in Java- Pros and Cons

02/22/2017 19:22:00 PM

The common way to create objects in Java is by using public constructors. A class provides public constructor e.g. java.lang.String so anyone can create an instance of String class to use in their application, but, there is another technique ...

Top 5 JavaScript Books to Learn - Best of Lot, Must Read

02/21/2017 19:08:00 PM

The JavaScript is the most popular programming language in Web, way ahead of popular ones like Perl, Ruby, and Python. It is also one of the essential skill for any Web developer. It is even true for Java developers. If you have JavaScript in ...

10 points about volatile modifier or field in Java

02/20/2017 19:12:00 PM

The volatile modifier has always been an interesting and tricky topic to many Java programmers. I still feel that it's one of the most underutilized modifiers in Java, which can do a lot of good if understood and applied correctly, after all, ...

Top 5 Core Java Books for Beginners - Learn Best of Lot

02/16/2017 20:52:00 PM

I have shared a lot of books related to Java and related technologies in the past e.g. Spring, Hibernate, JVM internals and performance tuning, multi-threading and concurrency, design patterns, data structure and algorithms etc, but I haven't ...

Top 6 SQL Query Interview Questions and Answers

02/15/2017 08:33:00 AM

The SQL, short form of Structured Query Language is one of the essential skills in today's programming world. No matter whether you are a Java developer, C++ developer or Python developer, you must know how to write SQL queries. Every programming ...

Top 5 Websites for Practicing Data structures and Algorithms for Coding Interviews Free

02/13/2017 19:06:00 PM

Are you preparing for Coding Interviews? If yes then you might know that there are a number of free online resources to practice important topics for coding Interviews e.g. data structure and algorithms, database and SQL, and others. These websites ...

How to Consume JSON from RESTful Web Service and Convert to Java Object - Spring RestTemplate Example

02/10/2017 20:39:00 PM

So far, I have not written much about REST and RESTful web service barring some interview questions e.g. REST vs SOAP, which is thankfully very much appreciated by my readers and some general suggestions about best books to learn REST in past, ...

17 Examples of Calendar and Date in Java

02/08/2017 21:27:00 PM

The java.util.Calendar class was added in Java on JDK 1.4 in an attempt to fix some flaws of the java.util.Date class. It did make some task simpler, e.g. create an arbitrary date comes easier using new GregorianCalendar(2016, Calendar.JUNE, ...

Top 10 Java wait, notify, Locking and Synchronization Interview Questions

02/06/2017 19:07:00 PM

There has been a lot of articles and books written on how to use wait and notify in Java, how they work, when do you need synchronization, and how to write concurrent code in Java, but, unfortunately, I still see many Java programmer struggles ...

Top 5 Books to learn REST and RESTful WebServices for Java Programmers

02/04/2017 20:49:00 PM

The REST has now become the standard way to develop web services. It's no more SOAP, who used to rule the world in last two decade. The SOAP and XML went very well together in past decade but it seems now REST and JSON have overtaken then and ...

Difference between JAX-RS, Restlet, Jersey, RESTEasy, and Apache CXF Frameworks

02/03/2017 07:03:00 AM

The JAX-RS is a Java specification request (JSR 311 & JSR 339) which standardize development and deployment of RESTful web services using Java and JEE technologies. It provides API in Java Programming language to create web services according ...

Where and How to download Spring Framework JAR file (Spring 4.0 or Spring 3.2) without Maven, Gradle

01/31/2017 18:40:00 PM

One of the easiest and oldest ways to run a Java program which depends on an external library or framework is to download dependency JAR files, put it on the classpath and then run the program by creating a Main class with the main() method. ...

Best Books to Learn Servlet and JSP

01/29/2017 22:25:00 PM

Unfortunately, there are not many good books to learn Servlet and JSP for Java web developers. Despite being the most popular Java Web technology, there are very few good books to learn Servlet and JSP. The one book, which everybody will suggest ...

Difference between for loop and Enhanced for loop in Java

01/29/2017 00:23:00 AM

Though you can use both for loop and enhanced for loop to iterate over arrays and collections like a list, set, or map. There are some key differences between them. In general, enhanced for loop is much more easy to use and less error prone ...

How to prepare for Java Interviews? Topics, Books, and Questions

01/26/2017 20:22:00 PM

Java Interviews are a little bit different than traditional programming interviews on tech giants and product based companies like Google, Amazon, Microsoft, or Facebook. First, even though it has questions from Data Structure and Algorithms ...

How to create LocalDateTime in Java 8 - Example

01/25/2017 09:00:00 AM

The LocalDateTime is a new class introduced in Java 8 new Date and Time API. This class is in java.time package and it represents both date and time information without timezone. In this example, you will learn different ways to create an instance ...

How to Split String based on delimiter in Java? Example Tutorial

01/23/2017 19:22:00 PM

You can use the split() method of String class from JDK to split a String based on a delimiter e.g. splitting a comma separated String on a comma, breaking a pipe delimited String on a pipe or splitting a pipe delimited String on a pipe. It's ...

Top 10 Excuses Programmers Gives to Avoid Unit Testing

01/22/2017 04:03:00 AM

Though everyone loves unit tests and everyone agree with benefits they bring in, when the time comes to write them, you will see a lot of excuses, even from some of the more experienced and senior developers. At the heart of the problem of not ...

How many characters is allowed on VARCHAR(n) columns in SQL Server? How much memory VARCHAR variable takes in disk?

01/21/2017 09:43:00 AM

One of the frequently ask SQL questions in any programming interviews is what is the difference between VARCHAR and CHAR data type in SQL? particularly when your project is using Microsoft SQL Server. You might have seen this couple of times, ...

Can we make an Array or ArrayList volatile in Java?

01/19/2017 19:22:00 PM

This is one of the many interesting multi-threading questions I have shared in my post 50 multi-threading interview questions. Yes, you can make an array volatile in Java, there is no problem with that, neither compiler will flag any error not ...

String replaceAll() example - How to replace all characters and substring from String

01/18/2017 19:20:00 PM

You can replace all occurrence of a single character, or a substring of a given String in Java using the replaceAll() method of java.lang.String class. This method also allows you to specify the target substring using the regular expression, ...

Top 10 UNIX and Linux System Programming Books- Best of Lot, Must Read

01/17/2017 19:25:00 PM

I have been sharing programming books in this blog from a long time, starting with core Java, I moved to other related technology e.g. Spring, Design patterns, Data Structure and Algorithms etc. Today, I am going to share some of the best UNIX ...

5 Free OCEJWCD 6 Mock Exam 1Z0-899 Practice Test

01/15/2017 19:42:00 PM

The OCEJWCD is the Oracle's version of SCWCD (Sun Certified Web Component Developer) exam, which tests candidate's knowledge on Servlet, JSP, and other web technology. The OCEJWCD stands for Oracle Certified Enterprise Java Web Component Developer. ...

Difference between PUT and POST in REST WebService in Java

10/24/2016 21:39:00 PM

If you remember REST WebServices uses HTTP methods to map CRUD (create, retrieve, update, delete) operations to HTTP requests. Even though both PUT and POST methods can be used to perform create and update operation in REST WebServices, Idempotency ...

How to enable SSL debugging in Java JVM?

10/23/2016 21:21:00 PM

Dealing with SSL issues in Java web application is no fun, especially when you have no debug logs and all you see is an ugly ‘Page Cannot be displayed’ error message in your browser. Thankfully you can easily enable SSL to debug on your ...

Restlet HelloWorld Example in Java and Eclipse

10/22/2016 23:38:00 PM

The Restlet is one of the first open source frameworks to create and deploy RESTful web service in Java. After the release of JAX-RS (Java API for RESTful Web Services) JSR - 317, Restlet also supports JAX-RS annotation and provides a consistent ...

How to get the last modified date and time of a file or directory in Java

10/22/2016 01:49:00 AM

Sometimes before processing a file, you want to check it's last modified date to avoid processing an old file. Though some programmers prefer to attach date in the file name itself, I don't find it a cleaner approach. For example, suppose ...

Difference between GETDATE() vs SYSDATETIME() vs GETUTCDATE() in SQL Server

10/20/2016 22:31:00 PM

One of the common question on Microsoft SQL Server interview is, what is the difference between GETDATE(), SYSDATETIME(), and GETUTCDATE(). Even though all three SQL Sever function returns the current date time in SQL Server, there are some ...

Top 2 Books for OCPJP8 Certification - Java 8 1Z0-809, 810, 813 Exam

10/19/2016 22:55:00 PM

This is the second part of best books for Java 8 certifications. Since you need to pass two exams, OCAJP8 and OCPJP8 to become a Java SE 8 certified developer, I have shared some of the best OCAJP8 books in the last article. In this article, ...

2 Ways to find Tomcat and Java Version in Linux and Windows

10/18/2016 23:22:00 PM

You can find Tomcat and java version running on Linux either by executing the org.apache.catalina.util.ServerInfo class from catalina.jar or by executing version.sh shell script. The first solution will work on any operating system including ...

How to replace a substring in Java?

10/17/2016 22:46:00 PM

You can replace a substring using replace() method in Java. The String class provides the overloaded version of the replace() method, but you need to use the replace(CharSequence target, CharSequence replacement). This version of the replace() ...

Base64 Encoding Decoding Example in Java 8

10/16/2016 21:56:00 PM

Until Java 8, there was no standard way to Base64 encode a String in Java or decode a base64 encoded String. Java Programmers either use Apache Commons library and it's Base64 class to encode or decode binary data into base 64 encoding, ...

Java Program to print pyramid pattern of stars and numbers

10/15/2016 22:29:00 PM

You can print Pyramid pattern of stars or numbers using loops and print methods in Java. There are two print method you need to know, System.out.print() and System.out.println(), the difference between print() and println() is that println adds ...

Difference between mvn install, release and deploy in Maven

10/14/2016 21:55:00 PM

Even though there are a couple of powerful build and deployment tools exists for Java applications e.g. Gradle or ANT, It seems Maven is the king of them. I have used in several Java projects over the years and it was initially ANT, but now ...

Best books to Learn Java 8

10/13/2016 22:15:00 PM

I often receive emails and queries asking about some good books to learn Java 8. Since Java 8 is very different from any other JDK release, in terms of language and API enhancement you really need a good book to learn fundamentals. In short, ...

How to check if String contains another SubString in Java? contains() and indexOf() example

10/13/2016 10:15:00 AM

You can use contains(), indexOf() and lastIndexOf() method to check if one String contains another String in Java or not. If a String contains another String then it's known as a substring. The indexOf() method accept a String and return ...

How to find square root of a number in Java - Algorithm Interview question

10/12/2016 01:57:00 AM

Write a program to calculate the square root of a number in Java or C++ is one of the popular coding interview questions from Programming job interviews both on tech companies like Facebook, Amazon, and investment banks like Citibank and Bank ...

How to check if a String is numeric in Java? Use isNumeric() or isNumber()

10/10/2016 21:43:00 PM

In day-to-day programming, you often need to check if a given String  is numeric or not. It's also a good interview question but that's a separate topic of discussion. Even though you can use a Regular expression to check if given String ...

How to check if ResultSet is empty in JDBC - Java Example

10/09/2016 21:00:00 PM

The JDBC ResultSet doesn't provide any isEmpty(), length() or size() method to check if its empty or not. Hence, when a Java programmer needs to determine if ResultSet is empty or not, it just calls the next() method and if next() return ...

Post Order binary tree traversal in Java - Recursion and Iteration

10/08/2016 23:27:00 PM

This is the third article on tree traversal. In the last couple of articles, I have shown you how to implement preorder and inorder traversal in Java, both recursively and iteratively and today, you will learn about the post order traversal. ...

How to split String in Java by WhiteSpace or tabs? Example Tutorial

10/07/2016 21:47:00 PM

You can split a String by whitespaces or tabs in Java by using the split() method of java.lang.String class. This method accepts a regular expression and you can pass a regex matching with whitespace to split the String where words are separated ...

How to increase heap size of Eclipse - Solving OutOfMemoryError

10/06/2016 20:57:00 PM

If you are running lots of Java projects in Eclipse and it's throwing OutOfMemoryError every now and then it's time to increase the heap memory of Eclipse. Since Eclipse is a Java program, you can increase heap size of Eclipse by using ...

How to convert java.util.Date to java.time.LocalDate in Java 8 - Example

10/05/2016 20:44:00 PM

The easiest way to convert a java.util.Date to java.time.LocalDate is via Instant, which is the equivalent class of java.util.Date in JDK 8. You can first convert util Date to Instant and then create a LocalDateTime object from that instant ...

How to Compare Date in SQL Server Query? Finding All Rows Between Two Dates

10/04/2016 20:59:00 PM

It's tricky to use dates in SQL server query, especially if you don't have good knowledge of how DateTime type works in SQL server. For example, one of the frequently asked SQL queries on the interview is to "select all rows where the ...

How to check if two Rectangle Overlap in Java - Algorithm

10/03/2016 21:12:00 PM

Can you write a Java program to check if two rectangles are overlapping with each other or not? is one of the frequently asked coding questions on tech giants like Facebook, Amazon, Microsoft and others. This is also a kind of problem where ...

3 ways to get number of months and year between two dates in Java?

10/02/2016 20:52:00 PM

Earlier I have talked about how to calculate a number of days between two dates in Java (see here), and now you will learn how to get the number of months and years between dates. Though it may look easy, it's not that easy to calculate ...

5 Best books for OCAJP8 Exam 1Z0-808 - Java8

10/01/2016 22:10:00 PM

It's been more than 2 years since Java SE 8 was launched on 17th March 2014 and almost 2 years since we have OCAJP8 live. You might know that in order to become a Java SE 8 certified developer you need to pass two examples, the OCAJP8 (Exam ...

3 Ways to Solve "No JVM installation found. Please install a 64-bit JDK" - Android Studio

09/30/2016 21:57:00 PM

You are an enthusiastic Java programmer who just learned about developing Android apps in Java. To start with you have installed Android Studio, which is the official Integrated Development Environment (IDE) for Android app development, based ...

How to Serialize Object in Java - Serialization Example

09/29/2016 20:58:00 PM

Serialization is one of the important but confusing concept in Java. Even experienced Java developer struggle to implement Serialization correctly. The Serialiation mechamism is provided by Java to save and restore state of an object progra ...

Iterative QuickSort Example in Java - without Recursion

09/28/2016 19:20:00 PM

The quicksort algorithm is one of the important sorting algorithms. Similar to merge sort, quicksort also uses divide-and-conquer hence it's easy to implement quicksort algorithm using recursion in Java, but it's slightly more difficult ...

Top 5 JSON Library Java JEE Developers Should Know

09/27/2016 20:40:00 PM

The JSON format is one of the most popular formats to transfer and exchange data in web. Almost all RESTful web services take JSON input and provide JSON output but unfortunately JDK doesn't have built-in support for one of the most common ...

How to get just DATE or TIME from GETDATE() in SQL Sever

09/26/2016 20:20:00 PM

The GETDATE is one of the most popular built-in methods of  Microsoft SQL Server, but unlike its name suggest, it doesn't return just date, instead it returns date with time information e.g. 2015-07-31 15:42:54.470 , quite similar to our ...

10 basic differences between Java and Groovy Programming

09/25/2016 20:39:00 PM

If you are working in Java, you might have heard about Scala, Groovy, and Closure. Out of these three Groovy seems to be gaining a place in Java projects more rapidly than others. Groovy is a Scripting language but runs on Java virtual machine. ...

How to Remove CTRL-M characters From a File in UNIX and Linux

09/24/2016 22:21:00 PM

I wanted to transfer some files from Windows to Unix using FileZilla, but the problem arises when these files are transferred (Ascii or Binary mode both) and opened using VI we get ^M characters, also known as CTRL-M characters. I searched about ...

Top 21 Java Final Modifier (Keyword) Interview Questions and Answers

09/23/2016 22:12:00 PM

The final modifier is one of the important keywords in Java. You can use this with a class, method, and variable as well. A good knowledge of final keyword is not only essential for writing good, performant and secure Java programs but also ...

3 Maven Eclipse Tips for Java Developers

09/22/2016 21:38:00 PM

If you are using Maven inside Eclipse IDE via M2Eclipse plugin then following tips can help you a lot.1) Setup Dependency as Java Project in EclipseIf your POM dependencies is another project in Eclipse then your project will automatically get ...

How to Print all Leaf Nodes of Binary tree in Java - Recursion and Stack

09/22/2016 01:06:00 AM

Binary tree based questions are very common in Java or any other Programming job interviews. One of the frequently asked binary tree questions is "write a program to print all leaf nodes of a binary tree". In order to solve this problem, you ...

2 Reasons of org.springframework.beans.factory.BeanCreationException: Error creating bean with name [Solution]

09/11/2016 23:59:00 PM

The Spring framework is one of the most popular frameworks for developing Java application. Apart from many goodies, it also provides a DI and IOC container which initialize objects and their dependencies and assemble them together. The Java ...

Best Book to Learn Java for C and C++ Programmer?

09/09/2016 22:08:00 PM

In the last 2 decade many Java programmers started programming with C and C++ but the situation is changed now, you have more choices e.g. you can choose Python or you can even start with Java. It seems Academia is preferring Python in USA and ...

Why use Spaces over Tabs for Indentation in Code Editors - Eclipse

09/08/2016 10:51:00 AM

When I started coding in Eclipse, I was not aware that by default Eclipse uses tabs for indentation and tabs can have varied with e.g. 1 tab can be equal to 2 spaces or 4 spaces or even 8 spaces. Sometimes, It's all up to you how you configure ...

Java Comparable Interface and compareTo() Example

09/06/2016 06:56:00 AM

Hello, guys, today I am going to talk about one of the fundamental concepts in Java, defining the natural ordering of the objects e.g. lexicographical order for String and numerical order for Number classes e.g. Integer, Double, Float etc. The ...

How to solve java.sql.SQLException: No suitable driver found for jdbc:mysql://localhost:3306/test

09/03/2016 05:53:00 AM

The error "java.sql.SQLException: No suitable driver found for jdbc:mysql://localhost:3306/test" occurs when you try to connect MySQL database running on your localhost, listening on port 3306 port from Java program but either you don't ...

Adapter Design Pattern in Java with Example

08/30/2016 09:04:00 AM

Adapter design pattern in Java, also known as the Wrapper pattern is another very useful GOF pattern, which helps to bridge the gap between two classes in Java. As per the list of Gang of Four patterns, Adapter is a structural pattern, much ...

5 Free OCAJP 7 and OCPJP7 Mock Exams - Online Practice Test (1Z0-803 and 1Z0-804

08/27/2016 21:53:00 PM

Hello guys, today I am going to share a list of free OCAJP7 and OCPJP7 mock exams and online practice tests. If you are preparing for Java SE 7 Programmer 1 or 2 certification or upgrading your existing OCJP 6 exam then this will help you to ...

java.lang.numberformatexception for input string null - Cause and Solution

08/27/2016 02:45:00 AM

The java.lang.NumberFormatException comes when you try to parse a non-numeric String to Number e.g. Short, Integer, Float, Double etc. For example, if you try to convert . "null" to an integer then you will get NumberFormatException. The error ...

5 Essential difference between Callable and Runnable interface in Java?

08/20/2016 03:06:00 AM

The difference between Callable and Runnable is one of the most frequently asked multi-threading and concurrency interview question in Java world. I remember, it was 2007 when I first heard about Callable interface and that too on a telephonic ...

InOrder traversal of Binary tree in Java using Recursion and Iteration

08/17/2016 08:53:00 AM

This is the second article about tree traversal algorithms using Java. In the first part, we have seen the pre-order algorithm for visiting all nodes of the binary tree and today we'll learn about the InOrder traversal. As I told you before, ...

Why Timestamp cannot be used in place of Date in Java?

08/15/2016 09:29:00 AM

One of the tricky question from Java Interview is, "Can we pass a Timestamp instance to a method expecting java.util.Date?", it's a tricky question because the answer is both Yes and No. You can, of course, pass a Timestamp object to a method ...

How to Iterate through ConcurrentHashMap and print all keys and values in Java

08/08/2016 10:19:00 AM

Suppose you have a ConcurrentHashMap of String and Integer and you want to print all keys and values, how do you that? This is a common, day to day programming task for Java programmer and there are many ways to do it. The Map interface provides ...

Top 10 Maven Plugins Every Java Developer Should Know

08/02/2016 11:10:00 AM

In the last couple of years, Maven has become the de-facto build tool for Java applications. Though there are challenges exists from tools like Gradle, but I think the dominance of Maven will help it to win the final battle. When I started with ...

How to find the 3rd element from end in linked list in Java

07/30/2016 23:35:00 PM

The problem to find the 3rd element from the end in a singly linked list or nth node from the tail is one of the tricky but frequently asked linked list problems in programming job interviews. The challenge here is to solve the problem in just ...

How to read a text file using Scanner in Java? Example Tutorial

07/24/2016 03:02:00 AM

As I told you before that there are multiple ways to read a file in Java e.g. FileReader, BufferedReader, and FileInputStream. You chose the Reader or InputStream depending upon whether you are reading text data or binary data, for example, ...

Difference between row_number(), rank() and dense_rank() in SQL Server, Oracle.

07/23/2016 09:32:00 AM

Though all three are ranking functions in SQL, also known as window function in Microsoft SQL Server, the difference between rank(), dense_rank(), and row_number() comes when you have ties on ranking i.e. duplicate records. For example, if you ...

How to calculate GCF and LCM of two numbers in Java? Example

07/18/2016 23:27:00 PM

This week's programming exercise is to write a Java program to calculate GCF and LCM of two numbers. The GCF, stands for Greatest common factor and LCM stands for Lowest common multiplier, both are popular mathematical operation and related ...

Difference in String pool between Java 6 and 7

07/15/2016 03:32:00 AM

String pool in Java is a pool of String literals and interned Strings in JVM for efficient use of String object. Since String is immutable in Java, it makes sense to cache and shares them in JVM. The String pool has gone through an important ...

Binary Tree PreOrder Traversal in Java - Recursion and Iteration Example

07/11/2016 08:48:00 AM

Unlike linked list and array which can only be traversed linearly, there are several ways to traverse a binary tree. The tree traversal algorithms are mainly divided into two parts, depth first and breadth first. As their name suggests, in depth ...

Eclipse - How to add/remove external JAR into Java Project's Classpath

07/09/2016 08:43:00 AM

There are multiple ways you can add an external JAR into the classpath of a Java project in Eclipse, but all goes via adding them into build path. Many beginner's struggles to add JARs into classpath and we will try to address that problem ...

How to remove duplicate rows from a table in SQL

07/07/2016 10:39:00 AM

There are a couple of ways to remove duplicate rows from a table in SQL e.g. you can use a temp tables or a window function like row_number() to generate artificial ranking and remove the duplicates. By using a temp table, you can first copy ...

10 Examples to read a text file in Java

07/05/2016 10:08:00 AM

The Java IO API provides two kinds of interfaces for reading files, streams and readers. The streams are used to read binary data and readers to read character data. Since a text file is full of characters, you should be using a Reader impl ...

Printing Largest and Smallest of N numbers without using Array in Java

07/02/2016 23:31:00 PM

One of the common programming questions is, how do you find the largest and smallest number in N numbers without using arrays in Java? Can you write a program to solve this problem? Well, it's very similar to the problem we have seen before, ...

How to take array input in Java using Scanner - Example

07/02/2016 05:54:00 AM

There is no direct way to take array input in Java using Scanner or any other utility, but it's pretty easy to achieve the same by using standard Scanner methods and asking some questions to the user. For example, if you want to take a ...

Top 5 Books for Programming/Coding Interviews - Best of lot

06/29/2016 08:54:00 AM

If you are preparing for Programming Job interviews and looking for some of the best books for programming questions then you have come to the right place. In this article, I am going to share a couple of good books to prepare coding, software ...

How to convert java.sql.Date to java.util.Date in Java - JDBC Example

06/27/2016 09:00:00 AM

You often need to convert java.sql.Date to java.util.Date while interacting with databases from Java application. Since JDBC the Java API for database connectivity uses java.sql.Date to represent and most of the java code accepts java.util.Date, ...

How to close telnet terminal in Linux and Windows (quit, exit not working)

06/25/2016 23:16:00 PM

The telnet is one of the most useful networking commands, which is used to check if a server is listening on a particular port on the remote host, but it's a little bit tricky to use, especially, if you are not using it daily. Though I have ...

How to make Eclipse use spaces instead of tabs in Java editor

06/25/2016 01:01:00 AM

I use Eclipse IDE extensively to write Java programs for testing and example purpose, but when I copy those program in any text editors e.g. VIM, Notepad, TextPad or Edit plus, the indentation goes weird. I see a lot of white spaces which makes ...

10 Examples of Joining String in Java 8 - StringJoiner and String.join()

06/22/2016 10:14:00 AM

It's quite common in day to day programming to join Strings e.g. if you have an array or List of String let's say {Sony, Apple, Google} and you want to join them by comma to produce another String "Sony, Apple, Google", there is not ...

Why use Log4j logging vs System.out.println in Java

06/20/2016 11:00:00 AM

Printing messages to the console is an integral part of development, testing and debugging a Java program. If you are working on a Server side application, where you can not see what's going on inside the server, your only visibility tool ...

How to install Maven on Windows 7,8 or 10?

06/19/2016 04:45:00 AM

There is no difference in installing Maven on Windows7, Windows 8, Windows 8.1 or Windows 10, you can follow the same steps to install Maven in any version Windows operating system. Installing Maven is very easy, just download the Apache Maven ...

Maven Eclipse Error - "No compiler is provided in this environment. Perhaps you are running on a JRE rather than a JDK"

06/18/2016 00:16:00 AM

If you are like many Java developer who uses Maven and Eclipse to build Java project using M2Eclipse plugin, you might have seen this error before. I ran into it recently when I ran the Maven Install command for one of the Java projects, configured ...

Top 5 Books to Learn Concurrent Programming and Multithreading in Java - Best, Must Read

06/15/2016 08:55:00 AM

Books are very important to learn something new and despite being in the electronic age, where books have lost some shine to internet and blogs, I still read and recommend them to get a complete and authoritative knowledge on any topic e.g. ...

How to add Primary key into a new or existing table in SQL Server

06/13/2016 09:49:00 AM

Since a primary key is nothing but a constraint you can use ALTER clause of SQL to add a primary key into existing table. Though it's an SQL and database best practice to always have a primary key in a table, many times you will find tables ...

2 Books to Prepare Java EE 6 Web Component Developer Certified Expert 1Z0-899 Exam (OCEJWCD)

06/11/2016 07:21:00 AM

Oracle launched "Java EE 6 Web Component Developer Certified Expert 1Z0-899 Exam" in 2011 to replace "Java Platform, Enterprise Edition 6 Java Server Pages and Servlet Developer Certified Expert Exam" and the "Oracle Certified Expert, Java Platform, ...

How to Remove Duplicate Characters from String in Java

06/09/2016 09:59:00 AM

This week's coding exercise is to remove duplicate characters from String in Java. For example, if given String is "aaaaaa" then output should be "a", because rest of  the "a" are duplicates. Similarly, if the input is "abcd" then output ...

Java Object Oriented Analysis and Design Problem - Vending Machine Part 2

06/07/2016 09:28:00 AM

This is the second part of Java tutorial to show how to create Vending Machine in Java. In the first part, we have discussed problem statement and the solution itself, but unit testing and design document was still pending, which we'll see ...

Design a Vending Machine in Java - Interview Question

06/04/2016 22:06:00 PM

How do you design a Vending Machine in Java? is one of the good Java interview questions mostly asked at Senior level Java developer Interviews. In a typical coding interview, you will be given a problem statement to develop a vending machine ...

10 Example of lsof commands in UNIX and Linux

06/02/2016 08:05:00 AM

It's been a long time I have written anything on UNIX or Linux, but today I'll talk about the lsof command, a utility command every system admin and developer love. The lsof command stands for list open file descriptors and as the name ...

What are Idempotent and Safe methods of HTTP and REST

05/31/2016 09:23:00 AM

In order to efficiently work with REST and RESTful web service, good knowledge of HTTP is really helpful. Even though REST seems easy, designing a uniform and consistent RESTful API is a tough job. One of the tricky tasks is choosing right the ...

Minecraft - java.lang.UnsatisfiedLinkError: lwjgl64.dll : Access Denied Solution

05/29/2016 04:07:00 AM

You can resolve java.lang.UnsatisfiedLinkError: lwjgl64.dll : Access Denied error in Minecraft by disabling your anti-virus and run. Later you can whitelist the lwjgl64.dll, so that your anti-virus will not block it again. I have talked about ...