In this tutorial, we will learn about the Java Wrapper class with the help of examples. The wrapper classes in Java are used to convert primitive types (int, char, float, etc) into corresponding objects. Each of the 8 primitive types has corresponding wrapper classes. Primitive Type Wrapper Class byte Byte boolean Boolean char Character double Double float… Continue reading Wrapper Class
Month: February 2022
File Class
In this tutorial, we will learn about Java File and its various operations with the help of examples. The File class of the java.io package is used to perform various operations on files and directories. There is another package named java.nio that can be used to work with files. However, in this tutorial, we will focus on the java.io package. File and Directory… Continue reading File Class
Java Generics
In this tutorial, we will learn about Java Generics, how to create generics class and methods and its advantages with the help of examples. The Java Generics allows us to create a single class, interface, and method that can be used with different types of data (objects). This helps us to reuse our code. Note: Generics does… Continue reading Java Generics
Lambda Expressions
In this article, we will learn about Java lambda expression and the use of lambda expression with functional interfaces, generic functional interface, and stream API with the help of examples. The lambda expression was introduced first time in Java 8. Its main objective to increase the expressive power of the language. But, before getting into… Continue reading Lambda Expressions
Auto boxing and unboxing
In this tutorial, we will learn about Java autoboxing and unboxing with the help of examples. Java Autoboxing – Primitive Type to Wrapper Object In autoboxing, the Java compiler automatically converts primitive types into their corresponding wrapper class objects. For example, Autoboxing has a great advantage while working with Java collections. Example 1: Java Autoboxing Output In… Continue reading Auto boxing and unboxing
Type Casting
In this tutorial, we will learn about the Java Type Casting and its types with the help of examples. Before you learn about Java Type Casting, make sure you know about Java Data Types. Type Casting The process of converting the value of one data type (int, float, double, etc.) to another data type is known as typecasting. In… Continue reading Type Casting
File Writer Class
In this tutorial, we will learn about Java FileWriter and its methods with the help of examples. The FileWriter class of the java.io package can be used to write data (in characters) to files. It extends the OutputStreamWriter class. Before you learn more about FileWriter, make sure to know about Java File. Create a FileWriter In order to create a file writer, we… Continue reading File Writer Class
File Reader Class
In this tutorial, we will learn about Java FileReader and its methods with the help of examples. The FileReader class of the java.io package can be used to read data (in characters) from files. It extends the InputSreamReader class. Before you learn about FileReader, make sure you know about the Java File. Create a FileReader In order to create a file reader, we… Continue reading File Reader Class
Output Stream Writer Class
In this tutorial, we will learn about Java OutputStreamWriter and its methods with the help of examples. The OutputStreamWriter class of the java.io package can be used to convert data in character form into data in bytes form. It extends the abstract class Writer. The OutputStreamWriter class works with other output streams. It is also known as a bridge between byte streams… Continue reading Output Stream Writer Class
Input Stream Reader Class
In this tutorial, we will learn about Java InputStreamReader and its methods with the help of examples. The InputStreamReader class of the java.io package can be used to convert data in bytes into data in characters. It extends the abstract class Reader. The InputStreamReader class works with other input streams. It is also known as a bridge between byte streams and character… Continue reading Input Stream Reader Class