Tag: core java

  • Integer to Roman Challenge in Java

    Integer to Roman Challenge in Java

    In this article, we will walk you through Integer to Roman in Java problem and what can be done to achieve faster results. 1. The Problem Given an integer number, we must return a String that represents the given number in Roman numerals. With some exceptions, Roman numerals are usually written from the largest (left)…

  • Java Enum (Enumeration)

    Java Enum (Enumeration)

    In this article we will look closely at Java Enum and understand what they are, how to define them, and how to make the most of them. 1. Overview of Java Enum Enumeration, enum for short, was first introduced in Java JDK 5 (1.5) and it has been widely adopted by developers and it is…

  • Java Record

    Java Record

    In this article, we’ll go through Java Record, which was introduced in Java 14 as a preview feature and became a permanent feature in Java 16 1. What is a Java Record Java Record is a type of class, that has some specific characteristics and restrictions: This means that by using records, you can omit…

  • NullPointerException in Java

    NullPointerException in Java

    In this article, we will talk about the infamous NullPointerException Java Error and how to solve it. 1. What is Null in Java? The null is a keyword and it means that an object’s address points to nothing. Moreover, all objects in Java are null by default unless we initialize them. Finally, a primitive can…

  • ArrayList in Java

    ArrayList in Java

    In this article, we’ll talk about ArrayList in Java, one of the most popular implementations of the List interface. 1. What is ArrayList in Java An ArrayList in Java is an implementation of the List interface. Hence, ArrayList is a List, however, if we take a look at the source code, we can see that…

  • Java List

    Java List

    In this article, we will talk about Java List, one of the most popular interfaces in Java. 1. What is a List in Java The Java List lives under java.util package and since it is an interface, it is not a concrete implementation. However, all implementations have some common characteristics: The UML diagram of List…

  • Java Substring

    Java Substring

    In this article, we’ll talk about Java substring method of String class. 1. What is substring Method in Java? The substring method lives under the String class and allows you to retrieve a substring of a specific string. It has two overloaded methods: 2. How to use substring method – Java substring Example In this…

  • Inheritance in Java

    Inheritance in Java

    In this article, we’ll go through Java Inheritance, one of the four Object Oriented Programming concepts, through detailed examples. 1. What is Inheritance in Java Inheritance in Java is just like the inheritance of characteristics that someone might get from his parents or grandparents. Exactly like in real life, children classes can inherit attributes or…

  • Encapsulation in Java

    Encapsulation in Java

    In this article, we’ll talk about one of the most important Object Oriented Programming concepts, Encapsulation in Java. 1. What is Encapsulation in Java Encapsulation in Java is a way to wrap members and methods of a class, into a single unit. Additionally, the goal of encapsulation is to hide all the data that should…

  • Java Abstract Class

    Java Abstract Class

    In this article, we’ll talk about what is an abstract class in java, why and how you should use it. 1. What is an Abstract Class in Java You can think of a Java abstract class as a semi-abstracted class, meaning that it is not an interface and at the same time it is not…