Home » Java Basics

Java Basics

Features & Changes in Java 17

Bipartite Graph

1. Introduction This article is design for the eager persons that want to keep up to date with the Features & Changes in Java 17. The cadence of Java versions is release every 6 months. The release date of this version was 14th September 2021, as the official site related. The current LTS version is JDK 17. Previous LTS version ...

Read More »

Java Escape characters list

Bipartite Graph

In this post, we feature a comprehensive article about escaping characters in Java. Why do we use Java Escape characters list so-called Sequence character? 1. Introduction Consider an example where I want to print the following message: My favorite movie is “Avengers” Let’s try to write the code to print this string. MyFavoriteMovieExample .java public class MyFavoriteMovieExample { public static ...

Read More »

Java Custom Exception Example

Bipartite Graph

In this example we will look briefly at the basics of Exception, in Java Programming Language. We will also see, how to create a custom Exception Class. 1. Basics of Exception As per oracle docs, An exception is an event, which occurs during the execution of a program, that disrupts the normal flow of the program’s instructions. In laymen terms, when ...

Read More »

Generic Method Example in Java

Bipartite Graph

In this example, we will be studying about generic methods and how to use the same in our programmes. Generic method, as the name suggests, is a method that does not specify the Type of its parameters, per se. Rather, it defines a criteria (or a place holder) by which, the method introduces its own type parameters. We will try ...

Read More »

java.lang.SecurityException – How to solve SecurityException

Bipartite Graph

In this tutorial we will discuss about SecurityException in Java. This exception is thrown by the security manager, in order to indicate a security violation. The SecurityException class extends the RuntimeException class and thus, belongs to those exceptions that can be thrown during the operation of the Java Virtual Machine (JVM). It is an unchecked exception and thus, it does ...

Read More »

Exception in thread “main” java.util.inputmismatchexception & How to solve it

Bipartite Graph

In this tutorial, we will explain the exception in thread “main” java.util.inputmismatchexception in Java. This exception is thrown by an instance of the Scanner class to indicate that a retrieved token does not match the pattern for the expected type, or that the retrieved token is out of range. The InputMismatchException class extends the NoSuchElementException class, which is used to ...

Read More »

java.lang.NoSuchFieldError – How to solve SuchFieldError

Bipartite Graph

In this tutorial we will discuss about the NoSuchFieldError in Java. This exception is thrown to indicate that an application tries to access or modify an object’s field, but that field no longer exists. This error can only occur during runtime, if the definition of a class has incompatibly changed. The NoSuchFieldError extends the IncompatibleClassChangeError class, which is used to ...

Read More »

java.lang.ArrayStoreException Example

Bipartite Graph

In this example we will discuss about ArrayStoreException. This exception is thrown when there has been made an attempt to store the wrong type of object into an array of objects. The ArrayStoreException extends RuntimeException, which means that it is an exception thrown at the runtime, so the try-catch block for this exception is not required. ArrayStoreException exists since JDK1.0. ...

Read More »

java.lang.StringIndexOutOfBoundsException – How to solve StringIndexOutOfBoundsException

Bipartite Graph

In this tutorial we will discuss about the java.lang.StringIndexOutOfBoundsException in Java. This exception is thrown by the methods of the String class, in order to indicate that an index is either negative, or greater than the size of the string itself. Moreover, some methods of the String class thrown this exception, when the specified index is equal to the size ...

Read More »