Exception Handling in Java

This article provides an introduction to exception and exception handling in Java.   Exceptions in Java   Exceptions represent exception conditions that alter the normal program flow. Exceptions can be hardware failure, resource availability,or even code issues or bugs.   Every exceptions an instance of a class that has Exception class in its inheritance hierarchy. […]

Java 8 Lambda Expressions

This article provides an introduction to lambda expressions introduced in JDK 8 and explains how to run them using functional interfaces. What is a Lambda expression in Java ?   A Lambda expression represents an Anonymous method.   Anonymous method concept is similar to that of an Anonymous class… the difference being it implements a […]

Different ways to reverse a String in Java

In this article, we will discuss different approaches to reverse a String in Java. Reverse a String in Java using StringBuffer and StringBuilder library functions String reversal algorithms in Java Reverse a String using Recursion Reverse a String word by word in Java Reverse order of words in a String in Java   Reverse a […]

Immutable in Java

  This articles focuses on the following : What is meant by an Immutable class in Java ? What is the advantage of an Immutable class ? How to create an Immutable class ? What happens when a variable or class is marked final ?   Immutability in Java An object is considered immutable if […]

Split string in Java

In this article, we will see different approaches to split a String in Java.   – Using String split() method – Using StringTokenizer – Algorithm to split a String in Java   Splitting a string using the split() method   Here is the syntax of the split() method :   public String[] split(String regex, [int […]