java

Map collection

3 minute read

A Map cares about unique identifiers. You map a unique key (the ID) to a specific value. You’re probably quite familiar with Maps since many languages suppor...

Set, Sorted Set, HashSet, TreeSet

3 minute read

Now let us say that we want to create a list that holds unique objects so what should we do? Should we use the normal list (ArrayList or LinkedList) to keep ...

List, ArrayList, LinkedList

7 minute read

A List extends Collection interface but it also cares about the index. The one thing that List has that non-lists don’t have is a set of methods related to t...

Iterators

3 minute read

When we are having a collection of objects we needed a mechanism to traverse through it. But no two implementations are going to be the same when we are impl...

Collection framework

4 minute read

A collection allows a group of objects to be treated as a single unit. Arbitrary objects can be stored, retrieved, and manipulated as elements of collections.

Comparable & Comparator

5 minute read

While writing the object-oriented programs, comparison of two instances of the same class is often required. Once instances are comparable, we can sort them ...

Java Serialization & Deserialization

6 minute read

Serialization lets you simply say “save this object state to the persistent store” you’d have to use one of the I/O classes to write out the state of the ins...

Java Formatters

5 minute read

Like all byte and character stream objects, instances of PrintStream and PrintWriter implement a standard set of write methods for simple byte and character ...

File Object

5 minute read

Objects of type File are used to represent the actual files (but not the data in the files) or directories that exist on a computer’s physical disk. First, l...

File Handling

3 minute read

To write anything to a file first of all we need a file name we want to use. The file name is a simple string like like this:

Console IO

2 minute read

Java was designed for graphical user interfaces (GUI) and industrial strength file and Internet I/O. No attempt was made to have simple input and output faci...

Streams, Readers & Writers

4 minute read

A stream represents a flow of data, or a channel of communication with (at least conceptually) a writer at one end and a reader at the other. When you are wo...

Java - Multi Threading

15 minute read

Nearly every operating system supports the concept of processes – independently running programs that are isolated from each other to some degree.

Thread - wait, join & deadlocks

4 minute read

The Java language includes three important methods that effectively allow one thread to signal to another. Without this facility, various constructs used in ...

Java - Assertions

3 minute read

Assertions are used to stop execution when “impossible” situations are detected. Assertions were introduced mainly to help the programmer to debug the applic...

Java - Exception Hierarchy

1 minute read

All exception classes are subtypes of the java.lang.Exception class. The exception class is a subclass of the Throwable class. Other than the exception class...

Java - Documentation

2 minute read

The JDK contains a very useful tool, called javadoc, that generates HTML documentation from your source files. If you add comments that start with the specia...

Java - Exception mechanism

7 minute read

An exception is a problem that arises during the execution of a program. An exception can occur for many different reasons, including the following:

Java - Exception Types

4 minute read

There are many predefined Exceptions available in java which are mentioned below, these are some of the common exceptions seen.

Java - Handling String

4 minute read

In Java, strings are objects. Just like other objects, you can create an instance of a String with the new keyword, as follows: String s = new String("abc");...

Java - Inner class

3 minute read

Inner classes let you define one class within another. They provide a type of scoping for your classes since you can make one class a member of another class...

Java - StringBuffer

2 minute read

The java.lang.StringBuffer class should be used when you have to make a lot of modifications to strings of characters. String objects are immutable, so if yo...

Java - Object class

4 minute read

The Object class sits at the top of the class hierarchy tree in the Java development environment. Every class in the Java system is a descendent (direct or i...

Java - Package - the class Management

6 minute read

Now we are aware of how to write the classes and are able to write simple programs in java, but what if our programs start to grow big, then how are going to...

Java - Inheritance deep dive

4 minute read

Ohh! Its inheritance again….. its freaking me out. I don’t understand what it is? We see this kind of reaction every time we someone is first told about, Let...

Java - Type Casting

4 minute read

The type casting comprises of two subtypes, a) Primitive type casting and b) Object Reference Type casting.

Java - Arrays

5 minute read

Array, what is it? An array is a group of variables of the same data type and referred to by a common name. An array is an object which is a contiguous block...

Java - Operators (Part - 1)

7 minute read

Java provides a rich set of operators to manipulate variables. We can divide all the Java operators into the following groups:

Java - Loop

3 minute read

You may encounter situations, when a block of code needs to be executed several number of times. In general, statements are executed sequentially: The first ...

Java - Control Structures

3 minute read

Java, like any programming language, supports both conditional statements and loops to determine control flow.

Java - Data Types

2 minute read

Java is a strongly typed language. This means that every variable must have a declared type. There are eight primitive types in Java. Four of them are intege...

Java - Programming Fundamentals (Part 1)

2 minute read

Hello Java is very close to the simplest program that can be done in a language. Nonetheless there’s quite a lot going on in it. Let’s see what it does. For...

Java - Programming Fundamentals (Part 4)

2 minute read

We have created our initial classes, so now we want to compile the classes. In order to do that we open the command line (To open command line, go to start m...

Java - Polymorphism & Encapsulation

2 minute read

Polymorphism means when an entity behaves differently depending upon the context its being used. Moreover In other words Polymorphism is the capability of an...

Java - Introduction to OOPs

2 minute read

Object-oriented programming (OOP) is a programming style that uses “objects” (data structures consisting of data fields and methods together with their inter...

Java - Inheritance

3 minute read

Inheritance is the concept of a child class (sub class) automatically inheriting the variables and methods defined in its parent class (super class).