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. package com.javahash.strings; public class StringMethods { /** * @param args */ public static void main(String[] args)… 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 package com.javahash.split;… 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

Facade – Design Pattern

According to the GoF, the goal of facade design pattern is to, “Provide a unified interface to a set of interfaces in a subsystem. Facade Pattern defines a higher-level interface that makes the subsystem easier to use.” To understand this better, let us take an… Read More