Java Control Flow Statements

To plan or decide something before implementation is always essential. This will help execute every step more efficiently, and you have an idea about the action that to be performed next. In computer language, decision-making is an important part. Predominantly, the execution starts from the top to the bottom. But sometimes, the decision is vital to know which block needs to perform next. Control flow in Java will help you to decide the next action. This article gives detailed information

Read more

Nested While Loop in Java

It is pretty impossible to impose hundreds of words or numbers by just writing or putting into variable one by one. Instead, use a loop to avoid extra time. This article gives an overview of nested while loop in Java and how to use them. Why use loops? Loops are the programming structure of an operation that repeats in a specific sequence until the particular condition or procedure is completed. Loops follow the don’t repeat yourself (DRY) principle for complete

Read more

Java Race Condition with Example

Sometimes, people detect some error in the program’s compile-time or run time, which mainly occurs due to race condition while executing programs. Are you excited to know more about race condition? This article will give a piece of detailed information on Race conditions in Java. Before proceeding to know about a race condition, let’s focus on threading. This will help you to understand the basics of race conditions. What is a thread, and why is it used? In java circumstances,

Read more

4 Pillars of OOPs in Java

As programmers work with real-life entities, object-oriented programming allows programmers to achieve the same. Objects are used to store knowledge, data, task, state, and other different OOP tasks and methods.  This article is going to explain the fundamental four pillars of object oriented programming in java. Image Source 1. Encapsulation Encapsulation is achieved when the object of the class maintains the private state. Other objects are not allowed to access these objects; despite that, the other objects can only access

Read more

Advantages and Disadvantages of Inheritance in Java

Inheritance is one of the pillars of the Java programming language. Learning OOP (Object Oriented Programming) without knowing and understanding the concept of Inheritance, its pros and cons are incomplete. Inheritance is a process in which a class acquires all the data members and its parent class methods. The basic idea behind it is that you create new classes based on the existing classes with additional data and methods. Example:

In the above example, there are two classes SuperHello

Read more

Java 3D Array – Three Dimensional Array

When you want to store a student’s list from a class and suppose the class consists of 100 students. By putting the data one by one into a variable will be time taking. While working with those variables and working with variables seems quite complicating and annoying. Therefore to avoid such a situation, an array is introduced, which can store data in a regular format. It is because of the array that operating on data became more accessible. First, get

Read more

Does Constructor Return Any Value?

To find out whether constructor returns any value or not, let’s learn about a constructor? In simple terms, the constructor is a special method, which is used to initialize an instance of a class. This special method differs from the actual methods of classes. The name of a constructor is always similar to the name of the class. Below is an example of a constructor:

How Constructor Work? Consider an example:

OUTPUT: Hello constructor The object is built

Read more

What is Native Method in Java?

Java uses various concepts to maintain privacy, structural format, and handling data efficiently, and many others. From all these concepts, one is to increase portability. To make the programs in Java more portable across all the platforms, the Java native interface (JNI) concept comes into the frame. JNI give out a bridge between Java and other native application. JNI is a segment of JDK (Java Development Kit), where JDK prefaces the java bytecode and the native programs (C and C++)

Read more
1 2