Home » Java Basics » Page 6

Java Basics

Java heap space – Everything you need to know

In this tutorial we will discuss about Java’s heap space. To begin with, the Java Virtual Machine (JVM) is the execution component of the Java Runtime Environment (JRE) that executes the bytecode residing in a Java .class file. While executing an application, new objects are created. The heap space is where all new objects are stored, while the application is ...

Read More »

Java Abstract Class Example

In this tutorial, we will discuss abstraction in java through examples. We are also going to talk about abstract class vs interface implementation in Java. Data abstraction is the process of hiding certain details and showing only essential information to the user. We can have abstraction with using either abstract classes or interfaces. An abstract class is a class that is declared using the abstract ...

Read More »

Java Development Kit: Starting with the Java JDK

In this tutorial we will present and describe the Java Development Kit (JDK). The JDK is a development environment for building applications, applets and components, using the Java programming language. The JDK among others includes the Java Runtime Environment (JRE), the Java compiler (Javac) and the Java APIs. The tools offered by the JDK are written in the Java programming ...

Read More »

Convert int to string Java Example (with video)

Integer to String conversion is a basic task in many Java projects. There are many ways to convert int to string in java, where some of them are very simple. In this example, we will show all the possible ways via an example on Java convert int to string. You can also check this tutorial in the following video: String ...

Read More »

java.lang.unsupportedclassversionerror – How to handle Unsupported Class Version Error

In this tutorial we will discuss about Java’s UnsupportedClassVersionError and how to deal with it. The UnsupportedClassVersionError is a sub-class of the LinkageError class and specifically, of the ClassFormatError class. This error is thrown by the Java Virtual Machine (JVM) when it tries to read a class file whose major and minor version numbers are not supported. This error exists ...

Read More »

java.lang.unsatisfiedlinkerror – How to handle Unsatisfied Link Error

In this tutorial we will discuss about Java’s UnsatisfiedLinkError and how to deal with it. The UnsatisfiedLinkError is a sub-class of the LinkageError class and denotes that the Java Virtual Machine (JVM) cannot find an appropriate native-language definition of a method declared as native. This error exists since the first release of Java (1.0) and is thrown only at runtime. ...

Read More »

Java String Array Example

Last updated Jan. 14, 2019 In this example we will show how to declare and populate a Java String Array as well as how to iterate through all its elements. 1. Example of Java String Array Create a java class named JavaStringArrayExample.java with the following code: JavaStringArrayExample.java package com.javacodegeeks.javabasics.stringarray; public class JavaStringArrayExample { public static void main(String args[]) { // ...

Read More »

java.lang.exceptionininitializererror – How to handle Exception Initializer Error

In this tutorial we will discuss about Java’s ExceptionInInitializerError and how to deal with it. The ExceptionInInitializerError is a sub-class of the LinkageError class and denotes that an unexpected exception has occurred in a static initializer or the initializer for a static variable. As of Java release 1.4, this error conforms to the general purpose exception-chaining mechanism. The ExceptionInInitializerError is ...

Read More »

Java Switch Case Example

In this post, we feature a comprehensive Java Switch Case Example. Java provides decision making statements so as to control the flow of your program. The switch statement in java is the one that we will explain in this article. These statements are: if...thenif...then...elseswitch..case A switch statement in java checks if a variable is equal to a list of values. ...

Read More »

For loop Java Example (with video)

In this post, we feature a comprehensive For loop Java example. If you need to execute a block of code many times, you will have to use the for loop or the enhanced for loop java provides.Java provides three looping mechanisms, which are the following: If you need to execute a block of code many times, then you will definitely ...

Read More »