Java – Multithreading with Example

What is Multithreading? The execution of multiple threads or tasks is called multithreading. The main purpose of multithreading is to achieve the simultaneous execution of more than two tasks so to maximize the use of CPU time. Thread is a light-weight sub-process or we can say that it is the smallest part of the process. … Read more

Java – Arrays

An array is a group or the collection of data having the same data-type. Arrays are objects in Java and with the fixed size(disadvantage). Elements are arranged inside the array with index numbers starting from zero as the first elements.Random access of any element present in the array and code optimization feature makes it more … Read more

Java – Multi-Dimensional Array

Declaring an array of arrays is known as Multidimensional Array or Jagged Arrays. In simple words, it is an array of arrays. It is created by appending a square brackets “[]” for each dimension. Here data are stored in a tabular form that is in row-major order as shown in an example below. Syntax: Declaration: … Read more

Java – One-Dimensional Array with Example

A one-dimensional array in Java is an array with a bunch of values that are declared with a single index. Here data are stored in a single column as shown below in an example. Array declaration: Example: An array declaration has two components:The type that is the data-type of an element and the name that … Read more

Java – Jump Statement

In Java, Jump statements are used to interrupt loop or switch-case instantly to transfer the program control from one point to elsewhere in the program.Java supports three jump statements: continue.  break  return. break:  This statement is used within the loop or switch cases to terminate that statement or the current loop is immediately stopped and … Read more

Java – continue statement with Example

It is one of the jump statement in java. It is used in loops to jump immediately to the next iteration of the loop. continue is used with while loop or do/while loop and with for loop. When continue is used inside for loop then the control immediately jumps to the increment or decrement part … Read more

Java – break statement with Example

It is one of the jump statement in java. This statement is used within the loop or switch cases to terminate that statement or the current loop is immediately stopped and resumes at the next statement followed by a terminated loop. we can also say that it helps to break out from the middle of … Read more

Java – Loops with Example

A loop statement allows us to execute a block of code or statement or group of statements as many times according to the user’s need. It is done by evaluating a given condition for true and false. The statement stops looping when the condition is false.There are two types of loops : 1. Entry control … Read more

Java – for loop with Syntax, Flowchart and Example.

The Java for loop allows the user to iterate a part of the program multiple times. If a user is certain about how many specific numbers of times the loop must be executed then for loop is recommended. It is also an entry-control loop but here flow control contains three steps: initialization = The first … Read more

Java – While Loop with Example

The while loop is one of the fundamental loop statements in Java. It is an entry-control loop that is it checks the condition at the beginning of the block. And repeats a statement or block until the condition is true. And the increment of the variable checked in condition checking is done inside the block … Read more