Home » java basics

Tag Archives: java basics

Could Not Find or Load Main Class in Java

In this tutorial, we will explain the error: could not find or load main class, the most common runtime exception in Java programming. The error usually occurs if the java command is unable to find or load the class that contains the main() method. 1. Introduction Before digging deep into the solution let us understand a few reasons for this error ...

Read More »

Java Heap and Stack

Hello readers, in this tutorial, we will learn about Heap space and Stack in Java. 1. Introduction In Java, the Java Virtual Machine (JVM) divides the memory into two parts i.e. Java Heap Space and Java Stack Memory. 1.1 Java Heap Space? Created by the JVM when it starts and the memory is allocated until the application is running Memory ...

Read More »

Float vs Double Java Example

Hello readers. In this tutorial we will learn about the float and double data types in the Java programming language. More specifically, we feature a comprehensive article about Float vs Double Java. 1. Introduction In Java programming, float and double data types both represent in floating-point numbers but a double data type is a little more precise than float. 1.1 ...

Read More »

How to write Java Doc

In this tutorial, we will learn how to write a Java Documentation (Java Doc or Javadoc) and the usage of JavaDoc tags. 1. Java Doc – Introduction We can use any JavaDoc tool of their preference or the ALT + SHIFT + J key for generating a standard HTML documentation. In this tutorial, we will primarily focus on the keyboard ...

Read More »

Getters and Setters Java Example

Hello readers! In this tutorial, we feature a comprehensive Getters and Setters in Java example. We will learn the Accessor and Mutator in Java programming language. 1. Introduction Java programming offers Accessor and Mutator or popularly called as Getter and Setter methods that are used to update the variable values and retrieve them. The following class illustrates the private variables ...

Read More »

Java XOR Operator Example

Hello readers, in this tutorial, we will explain the Java XOR operator. We’ll cover the XOR symbol that is an operator that falls under the Bitwise category. 1. Introduction Java programming offers Operators that are used to perform various operations in Java. 1.1 XOR operator in Java The XOR operator is denoted as ^ in the programming language and works ...

Read More »

Basic Operators – Java += Operator

Hello readers, in this tutorial, we will learn the Java += operator. 1. Introduction Java programming offers Operators that are used to perform various operations in Java. In this tutorial, we’ll only cover the += operator that falls under the Compound Assignment operators’ category. 1.1 Compound assignment operators in Java Following table list the different compound assignment operators. Operator Description ...

Read More »

Declare Array Java Example

In this tutorial, we will learn how to declare arrays in Java. We will explain what an array is and how to initialize it in Java using examples. You can watch the following video and learn how to use arrays in Java: Java Array Example How to use Arrays in Java – Video 1. Introduction Java programming offer Arrays to ...

Read More »

Basic Operators: OR in Java

Hello readers, in this tutorial, we will learn the operator OR in Java programming language. 1. Introduction Java programming offer Operators that are used to perform various operations . In this tutorial, we’ll only cover the OR operator that falls under the Conditional and Bitwise category. 1.1 Conditional operators in Java Following table list the different conditional operators. Operator Description ...

Read More »

Char Array to String Java Example

Hello readers! In this tutorial, we feature an example on how to convert a Char Array to String in Java. We will learn different ways of this conversion. Meanwhile, you can also check the String to Char Array Example. 1. Introduction Java programming offers possible ways to convert a character array (char []) to String. A new String is allocated ...

Read More »