Category Archives: Java

How to Read an Object from file in Java

In this java example and tutorial about “How to Read an Object from file in Java”, you will learn how to read an object from the saved file or how to deserialize the serialized file. In the previous java example, you learn about how to write an Object into a file. The deserialization process is quite similar with the… Read More »

How to Write an Object to file in Java

In this java tutorial i will share about “How to Write an Object to file in Java”. Java object can write into a file for future access, this is called Serialization. In order to do this, you have to implement the Serializable interface, and use ObjectOutputStream to write objects into a file. FileOutputStream fout = new FileOutputStream(“c:\\temp\\address.ser”); ObjectOutputStream oos = new ObjectOutputStream(fout); oos.writeObject(address);… Read More »

How to open a PDF file in Java on Windows / Any Platform

In Java development, sometimes we need to open a PDF file with java code. So in this java tutorial and example, we will show you two ways to open a PDF file with Java. 1. rundll32 – Windows Platform Solution In Windows, you can use “rundll32” command to launch a PDF file, see example : package com.cimblo.jdbc; import… Read More »

How to Read CSV file in JAVA

How to Read CSV file in JAVA – In this java tutorial i will show you about parsing CSV data in java code or import data from CSV file in Java. A Comma-Separated Values (CSV) file is just a normal plain-text file, store data in column by column, and split it by a separator (e.g normally it is… Read More »

How to Export Data to CSV file in JAVA

In this java tutorial and example you can learn “How to Export Data to CSV file in JAVA“. A Comma-Separated Values (CSV) file is just a normal plain-text file, store data in column by column, and split it by separators (commas). Export data to CSV with Java programming language is very easy. Note Writing a CSV file is just like… Read More »

How To Convert JAVA object to / from JSON (Jackson 2.9.4)

How To Convert JAVA object to / from JSON (Jackson 2.9.4) will be explain in next java tutorial. This is how to use Jackson 1.x data binding to convert Java object to / from JSON. Note Jackson 1.x is a maintenance project, Jackson 1.x is obsolete, no more update, please refer to the latest and please use Jackson 2.9.4 instead.… Read More »