Tag: Java

Converting a String to char is a common task in Java. Java provides several ways to achieve this. In this blog post, we’ll cover the primary methods and highlight when to use each one. String to char Using charAt() Method The most common way to convert a String to char is by using the charAt() […]Continue reading

The if else statement is a fundamental control structures in Java.. This structure evaluates conditions and executes code based on whether those conditions are true or false. Let’s look at how to use if, if else, and else if statements effectively. The Java if Statement An if statement evaluates a condition and runs the code […]Continue reading

The substring() method in Java is a tool for manipulating strings. It allows you to extract a portion of a string by specifying a start index, and optionally, an end index. Basic Usage of substring() The Java substring() method has two variations: In this example: Important Details Substring Use Cases The Java substring() method is […]Continue reading

Converting an int to a String is a common task in Java, especially when working with user interfaces, file output, or JSON formatting. Java provides several ways to perform this conversion, each with different use cases and characteristics. In this blog post, I will cover the most popular methods for converting int to String and […]Continue reading

String to int conversions are a common task in Java, especially when dealing with user input or API calls. Java provides several ways to perform this conversion. This blog post will cover the most common methods for converting a String to an Integer and cover best practices to avoid potential errors. String to int Using […]Continue reading

This tutorial covers the Java XOR operator, represented by the ^ symbol, which operates on boolean and integer types. It explains how XOR functions as a logical operator for booleans, returning true for different values, and performs a bitwise operation for integers, illustrating with examples and truth tables.

In September 2021, Java 17 was released as the latest LTS (long-term support) replacing Java 11. Now the big question is “What is new in Java 17?” Java 17 has 14 JDK Enhancement Proposals (JEP) items. Out of those, there are 10 new features, 2 feature removals, and deprecation of 2 features. In this post, […]Continue reading

A Deque is a linear collection that supports element insertion and removal at both ends. The name deque is short for “double ended queue” and is usually pronounced “deck”. The Deque interface defines methods to access the elements at both ends of the deque. Methods are provided to insert, remove, and examine the element. Each […]Continue reading

In Java, you use the enumeration type to represent a list of predefined constants. But, what if you want to implement a Set interface with the enumeration type, you have got EnumSet in Java to do so. Enum constants are unique and have predefined length, as you can not define a new enum constant at […]Continue reading