Tag: core java

  • Java String

    Java String

    In this article, we’ll talk about one of the most important classes in Java, the String class. 1. What Is String in Java? A Java String is basically an array of characters. Additionally, all Strings are immutable so you cannot really change the value of a String, the only way to “change” it, is to…

  • Polymorphism in Java

    Polymorphism in Java

    In this article, we’ll talk about what polymorphism is in Java and how you can apply it in your own applications. 1. What Is Polymorphism in Java? Polymorphism (Πολυμορφισμός in Greek) comes from the Greek word “poly” (πολύ) which means many, and “morphs”(μορφές), which means forms. So should we take the whole word, it means…

  • Java Interface

    Java Interface

    In this article, we’ll go through what an interface is in Java, why you should use it and when you should use an interface. 1. What Is a Java Interface? An interface in Java is like an abstract class, but it provides full abstraction as you mainly do not implement methods (although since Java 8…

  • Java Constructor

    Java Constructor

    In this article, we’ll go through what a Java constructor is and it works. 1. What Is a Java Constructor? A constructor is a block of code, which might seem similar to methods at first, but has some fundamental differences compared to them. You can utilize a constructor for the creation of a new object.…

  • Java Operators

    Java Operators

    In this tutorial, we will go through all operators that exist in Java and explain when, how, and why you should use them. 1. Java Operators Overview Operators in Java are symbols that are used in combination with variables, in order to perform specific actions. You have used operators many times in your math classes,…

  • Access Modifiers in Java

    Access Modifiers in Java

    In this article, we’ll explain what access modifiers are in Java and how they work. 1. What Are Access Modifiers? Access modifiers are keywords that define which classes can access specific classes, members, or methods. The available keywords are: public: This class, member, or method can be accessed from everywhere. protected: The class, member, or…

  • If Statement in Java

    If Statement in Java

    In this article, we will analyze one of the most used commands, the if statement in Java, through detailed examples 1. If, Else If, and Else Statements Syntax The Java if statements are used when we need to do some actions, based on whether a statement is true or false. 1.1 If statement in Java…

  • Java Map

    Java Map

    In this article, we will talk about Java Map Interface which is under java.util package, how it works, and analyze its main implementations. 1. What is a Map in Java You can imagine a Map as a Data Structure which contains Key-Value pairs. This mapping is an Entry of the Map. For example, it could…

  • Java Array

    Java Array

    In this article, we will explain what an array is in Java, how it works, and when it should be used. Every section will include code examples in order to understand the most important aspects of Java arrays. 1. What is a Java Array? An array is a fixed-length object which contains one or more…

  • HashMap in Java

    HashMap in Java

    In this article, we will explain what a HashMap is, analyze the constructors and methods of HashMap class in Java, and then go through a real-world use case of HashMap. 1. What is a HashMap and how it works HashMap in Java is a Key-Value Data Structure. The HashMap class in Java inherits from AbstractMap…