Tag: core java

  • Java Switch

    Java Switch

    In this article, we will look over the switch keyword in Java and all the enhancements it has received up to JDK 17, including the switch expression. 1. What is a Switch Statement? Switch is a selection statement that allows you to control the flow of the execution of your application. It works as a…

  • While Loop in Java

    While Loop in Java

    In this article, we’ll go through while loop in Java, one of the fundamental statements that every programmer should now 1. What is a Java While Loop? Java While Loop is a statement that allows you to execute a set of commands only if a statement evaluates to true. Additionally, while loop is used when…

  • For Loop in Java

    For Loop in Java

    In this article, we’ll go through what for loop in Java is and how you can take full advantage of it. 1. What is a For Loop in Java Java for loop is a statement that allows you to run a set of commands, a predefined number of times(although if you use break or continue,…

  • Final Keyword in Java

    Final Keyword in Java

    In this article, we will go through what the final keyword does in Java, and when and how you should use it. 1. What Does final Mean in Java The final keyword in Java has a different meaning depending on where you apply it: When it comes to a variable, it means that you cannot…

  • Java LinkedList

    Java LinkedList

    In this article, we are going to go through everything you need to know to use Java LinkedList appropriately and what happens behind the curtains when we use it. We will cover both its practical and theoretical use. 1. What is a LinkedList? In Java, a LinkedList is a doubly linked list, and it is…

  • Java 8 Stream API

    Java 8 Stream API

    In this article, we’ll learn everything regarding Java Stream API that was introduced in Java 8, through detailed examples. 1. What Is a Java Stream? You can think of a stream as a sequence of elements, that allows you to perform sequential and parallel operations. Furthermore, you cannot add any elements once the stream has…

  • Multithreading in Java

    Multithreading in Java

    In this article, we will learn what multithreading is and how to multithread in Java. 1. Multithreading in Java Overview Java Multithreading allows us to execute multiple tasks at the same time preventing our application from hanging for a long time giving the impression it has frozen or crashed. 1.1 What’s a Thread? To understand…

  • How to Initialize an Array in Java

    How to Initialize an Array in Java

    In this article, we’ll go through how you can initialize an array in java, through detailed examples. 1. How to Initialize a 1D Array To create a one-dimension array in Java, the formula is the following: For example, we could initialize an array of type Person and length 3, with the following command: In addition,…

  • List to Array in Java

    List to Array in Java

    In this article, we’ll go through all the ways possible to convert a list to an array in Java. 1. How to Convert a List to Array in Java There are many ways to convert a list to an array in Java; you can either do it by using a loop (for, for each, java…

  • For Each Loop in Java

    For Each Loop in Java

    In this article, we’ll go through what for each loop in Java is, and how you can use it. 1. What is a For Each Loop For Each Loop is like the classic for loop, but with a much simpler syntax than the classic for a loop as you only need to know the name…