Java

What are the different data types in Java?

What are the different data types in Java?

In Java, there are various data types, which determine the kinds of values a variable can store and display. In addition to eight primitive data types, which are organised into four categories, there are also numerous complex data types. Complex data types allow you to create…

Read more
How to convert an int to a string in JavaG-Stock StudioShutterstock

How to convert an int to a string in Java

In Java, you can convert the primitive data type integer into the complex data type string. There are a couple of things to pay attention to when making this conversion, to ensure that it goes smoothly. In this article, we show you five different ways to convert a Java int to a…

Read more
How to use the Java modulo operator

How to use the Java modulo operator

Java’s modulo is also known as the remainder operator. It is used to determine what the remainder is after dividing two numbers and takes that into account in your code. In this dedicated article, we explain why the modulo operator is so important in Java and we also show you how…

Read more
What is a Java HashMap and how to use itChinnapongShutterstock

What is a Java HashMap and how to use it

One of the most effective ways to store and retrieve data in a targeted manner is to use key-value pairs. In Java, you can use the HashMap class to do this. In this tutorial, we explain what a Java HashMap is and how the class works using practical examples. We’ll look at how to…

Read more
How to use the Java method main():sdecoretShutterstock

How to use the Java method main():

The most important factor in any application written or used with the Java programming language is the Java main() method. After all, it serves as the entry point for every Java program. In this article, we’ll explain exactly what the main() method in Java is, how it works and…

Read more
How the Java instanceof operator works

How the Java instanceof operator works

To prevent error messages in your code, it’s best to make sure that objects and classes match. The most useful way of doing this in Java is with the instanceof operator. In this article, we’ll go over what instanceof is and provide you with practical examples of how the operator…

Read more
How to use Java BigDecimal to display floating point numbers

How to use Java BigDecimal to display floating point numbers

In situations where the smallest digit after the decimal point is important, you need programs that can display these reliably. Java uses BigDecimal, a class that can represent and process complex floating point numbers in detail. In this article, we’ll show you how to use the…

Read more
How Java Math class works

How Java Math class works

Java’s Math class is a valuable tool for doing calculations in Java. It uses a simple syntax and can be used to perform logarithms, trigonometric tasks and simple numerical calculations. Here you can find out how the Math class works in Java and which methods you can use. We’ll…

Read more
What are Java bitwise operators and how to use them

What are Java bitwise operators and how to use them

If you want to change individual bits, Java’s solution is bitwise operators. With Java bitwise operators, you can step in and manipulate bits in whatever way you’d like. We’ll show you which bitwise operators are available in Java and go over their benefits. We’ll also use some…

Read more
What are Java comments and how to create themChinnapongShutterstock

What are Java comments and how to create them

If you’re working with source code, it often makes sense to explain work steps. This not only makes it easier for you to find your way around a project, it also makes it easier for other people to collaborate with you. With comments in Java, you can leave explanations directly in…

Read more
Page top