How to concatenate String in Java

In java we can concatenate string using the concat method of the java.lang.String class. Concat method appends the input string to the current string and returns the combined string.

Above code concatenates two strings – merges into a single string. This is not efficient… Read More

How to Split or Tokenize a string in Java

The java.util.StringTokenizer can be used to split a string into individual tokens. As this class is deprecated now, it is better to use the split method of java.lang.String. Methods String[] split(String regex) – Splits the string according to the regular expression   Example

 … Read More

Java Static Keyword Example

In Java, the static keyword can be applied to four programming artifacts They are Static Variable When many instances of a class are created, each instance will have its own copies of instance variables. That means number of objects created from the same blue print (… Read More

Java – Exception handling

An exception is a condition that arises during the execution of a java program. It can occur due to many reasons. For instance, Invalid data Business validation Input out put issue Socket connection problem Data base issue These exception can occur in different categories as… Read More

How To Sort An ArrayList In Java

ArrayList is one of the most commonly used data type in java.  ArrayList  keeps the data against and index and knowing the index, you can retrieve the value. If you don’t have the index, you have iterate through the array to find the value. ArrayList… Read More