Author: geonikpal

  • Java Stream Reduce

    Java Stream Reduce

    In this article, we’ll go through how you can use the Java Stream Reduce method of Stream API. 1. Java Stream Reduce Overview In general, reduce methods are used to combine multiple values into one result; Java stream.reduce() does the same. Also, note that unlike map() and filter(), reduce() is a terminal operation so you…

  • Java Stream Map

    Java Stream Map

    In this article, we’ll go through the Java Stream map() method through detailed examples. 1. Java Stream Map Method Overview The stream.map() method is used to transform an object or primitive into something else. The syntax of this method is the following: The function could have one of the following syntaxes: 1.1 One-Line Lambda The…

  • Java Stream Filter

    Java Stream Filter

    In this article, we’ll go through the Java Stream filter() method through detailed examples. 1. Java Stream Filter Method Overview The stream.filter() method is used to filter an object or a primitive based on the truthness of a boolean. The syntax of this method is the following: The predicate could have one of the following…

  • Ternary Operator in Java

    Ternary Operator in Java

    In this article, we’ll go through what the Ternary Operator is in Java and how it works. 1. What is Ternary Operator in Java? The ternary operator is the ? followed by 2 : and it can be used to assign a value to a variable based on the truthiness of a condition. The syntax…

  • Java String compareTo() Method

    Java String compareTo() Method

    In this tutorial, we’ll go through compareTo() Java method of the String class. Additionally, we’ll look into compareToIgnoreCase() method and how it differs from compareTo(). 1. What is String compareTo in Java? The String compareTo() method can be used to compare two strings lexicographically based on the sum of the Unicode value of each character.…

  • String Split in Java

    String Split in Java

    In this article, we’ll go through how you can use Java string split methods of String class. 1. Java String Split Method with a Regex This method will split the string based on the regex you provided and return an array of strings with the items you want. Of course, the regex that matched will…

  • SQL Update

    SQL Update

    In this article, we’ll go through how you can update entries using SQL. In order not to have to install any RDBMS to go through this example, we’ll use Postgres online from extendsclass.com. 1. What Is an Update Statement in SQL? In many cases, we need to update a column value based on some conditions.…

  • Java String Replace Methods

    Java String Replace Methods

    In this article, we’ll go through how you can replace either a character or a string inside a String in Java. 1. Java String Replace without Regex. In this section, we’ll go through the two methods String class provides us for replacing either a character or a string. 1.1. Replace a Character Using replace(Character oldChar,…

  • 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…