Home » Archives for Shaik Ashish

Author Archives: Shaik Ashish

Shaik Ashish
He completed his Bachelors Degree in Computer Applications. He is a freelancer, writer, Microsoft Certified in Python and Java. He enjoys Writing, Teaching, Coding in Java and Python, Learning New Technologies and Music.

How to initialize an ArrayList in Java

In this article we will explain how to initialize an ArrayList in Java through example. 1. Introduction ArrayList is a part of the Collection Framework and is present in java.util package. It provides us dynamic arrays in Java. Though, it may be slower than standard arrays but can be helpful in programs where lots of manipulation in the array is needed. ...

Read More »

Java Finally keyword Example

1. Introduction In this post, we will discuss the Finally keyword in Java. The finally keyword is used for a block as part of a try-catch. Java finally block is a block that is used to execute important codes such as closing connection, stream, etc. Java finally block is always executed whether an exception is handled or not. This ensures that the code ...

Read More »

Basic Operators: % in Java

1. Introduction In this post, we will understand the Modulo operator – % in Java. Java Modulo operator or modulus operator is used to getting the remainder when we divide an integer with another integer. It is a binary operator as it is applied to two operands. The % character is the modulus operator in Java. Its syntax is: int ...

Read More »

Protected Java Keyword Example

In this article, we talk about protected Java keyword and Java access Modifiers. 1. Introduction A Java protected keyword is a Java access modifier. It can be assigned to variables, methods, constructors, and inner classes. The protected access modifier is accessible within the package. However, it can also accessible outside the package but through inheritance only.We can’t assign protected to ...

Read More »

Java Stream – How to use Java 8 streams

1. Introduction In this post, we will learn about how to use a Stream in Java, which was introduced as part of Java 8 version. Let us understand what actually the word streaming means with an example and what the java 8 API provides with regard to methods. When you start watching a video, a small portion of the file ...

Read More »

Java Assert Keyword Example

In this article, we will explain what is the Assert Keyword in Java using examples. We will also create an example about assertion, that allows testing the correctness of any assumptions that have been made in a program. 1. Introduction An assertion is achieved using the assert statement in Java. While executing an assertion, it is believed to be true. If it ...

Read More »

Java Final Keyword Example

1. Introduction In a programming language like Java, the word final is a keyword that is used as an access modifier before variables, methods, and classes. A keyword is a word that has special meaning for the compiler and cannot be used as an Identifier in a language. The final word can be used before a variable or before a ...

Read More »

Min Heap Java Example

In this article, we will explain what Min Heap is in Java using examples. We shall discuss Heap Data Structure and its implementation in Java. 1. Introduction Heap is a binary tree-based data structure. Now let us understand each word in this sentence in greater detail. Tree:- A tree is a hierarchy based data structure, you have a certain order ...

Read More »

Unreachable Statement Java Error – How to resolve it

In this post, we shall look into Unreachable Statement Java Error, when does this occur and its resolution. 1. Introduction Unreachable Statement is an error raised as part of compilation when java compiler detects code which is never executed as part of execution of program. Such code is obsolete, unnecessary and therefore it should be avoided by the developer. This ...

Read More »

Polymorphism Java Example

In this post, we feature a comprehensive Polymorphism Java Example. 1. Introduction In word Polymorphism, the word Poly stands for ‘many’ and the word morph stands for ‘forms’. Polymorphism is the ability of an object to take on many forms. Polymorphism is the capability of an action or method to do different things based on the object that it is ...

Read More »