Data Types

Java 14

Java Record Type

Java records were introduced as a preview feature in Java 14 [JEP-359] and finalized in Java 16 [JEP-395]. A record, in Java, acts as a transparent carrier for immutable data. Conceptually, records can be thought of as tuples that are already available via 3rd party libraries. Though, records are built-in type in Java so they provide …

Java Wrapper Classes, Autoboxing and Unboxing

Learn about Java wrapper classes, their usage, conversion between primitives and objects; and autoboxing and unboxing with examples. 1. Java Wrapper Classes In Java, we have 8 primitive data types. Java provides type wrappers, which are classes that encapsulate a primitive type within an Object. A wrapper class wraps (encloses) …

Java Data Types with Examples

Learn about various data types in Java. Learn the differences between primitive datatypes and non-primitive datatypes (or reference datatypes). We will also learn about the data types sizes and best practices for using datatypes in Java. 1. How to Declare a Variable in Java? In Java, typically datatypes are associated …

Java Primitive Datatypes and Ranges

All the values in Java are divided into two categories: reference types and primitive types. Learn about eight Java primitive data types.

About Us

HowToDoInJava provides tutorials and how-to guides on Java and related technologies.

It also shares the best practices, algorithms & solutions and frequently asked interview questions.