Maps in Java

maps java

* ArrayList and LinkedList are part of java.util.collections framework and Maps are part of java.uti ... 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

Arraylists in java

arraylists java

* Arraylist is a class that inherits the List interface * To define a list ---> ``` ArrayList< ... Read More

Mutilpe catch block in java using (|)

multiple catch blocks java

If we have multiple catch blocks for a try block we can even catch both exceptions in one catch bl ... Read More

More regular expressions for replaceAll( for digits ,alphabets,white spaces or just tabs)

More regular expressions for replaceAll( for digits alphabets white spaces or just tabs) java

Replaces any numbers with x ``` System.out.println("abCdeFGH123456789".replaceAll("[0-9]", ... Read More

Reading and writing byte streams using java nio

reading writing byte streams nio java

Here we will learn how to write data in binary format. In the earlier post we learned how to write ... Read More

Writing to a text file using try with resourcesJava

FileWriter I/O try with resources java

Try with resources is available since java 7. So in order to use try with resources we need to go to ... Read More

Generic types in java

generic types java

Generics are used to create classes, interfaces and methods that take types and parameters and thes ... Read More

Access modifiers in java

access modifiers java

Access modifiers and Scope Types of access modifiers 1.Public - can be accessed in any Class ... Read More

Creating our own exception classes in Java

creating our own exception classes java

We can even create our own exception class in java. Our own exception class should always extend Ex ... Read More