throw vs throws exception in java

throw throws exception java

We can throw exception deliberately in java using the below line of code ``` throw new NullPo ... Read More

Creating temporary files in java

Creating temporary files java

We can create temporary files in Java like in the code below Here first argument is the name ... Read More

Regular expression ecample for postal code

Regular expression ecample for postal code java

Below is the req expression to match 5 digits and then we put () and inside those braces we put - t ... Read More

Method overiding vs method overloading

method overiding vs method overloading java

Method overloading * methods must have same name and different paramaters * They may or may not ... Read More

Static initialisation blocks

static initialisation blocks java

* A class can have as many static initialisation blocks as we want * Please note that all sta ... Read More

Maps in Java

maps java

* ArrayList and LinkedList are part of java.util.collections framework and Maps are part of java.uti ... Read More

Yet another group pattern example

Yet another group pattern example java

If we just want to print the numbers in the below String we can create a group for those numbers. An ... Read More

Composition

Composition java

Compostion should be preferred over inheritance and should be used if the classes don't have a paren ... Read More

Comparator interface java

comparator interface java

There are two ways to compare objects of a list .First one is to use compareTo method and for that w ... Read More

Unmodifiable collection in Java

Unmodifiable collection java

The below command is used to return a unmodifiable list,map or set which can't be modified so origin ... Read More