Category Code Base

How to read a File using Scanner Class

Here we are discussing about reading the file using Scanner. To learn to read File using BufferedInputStream  Click Here. package JavaIOExample; import java.io.File; import java.io.FileNotFoundException; import java.util.Scanner; /* * Here we will learn to read the file using Scanner. */ public class…

How to read a File using BufferedInputStream

Here we are discussing about reading the file using BufferedInputStream. To learn to read File using Scanner  Click Here. package JavaIOExample; import java.io.BufferedInputStream; import java.io.DataInputStream; import java.io.File; import java.io.FileInputStream; import java.io.FileNotFoundException; import java.io.IOException; import java.util.Scanner; /* * Here we will learn…

How to Convert Boolean Object to boolean primitives

/* * Here we will learn to convert Boolean Object to boolean primitives */ public class ConvertBooleanPrimitives { public static void main(String[] args) { /* * Boolean constructor with String argument allocates a Boolean object * representing the value true…

Create Excel file in java using PoI

package com.howto; import java.io.File; import java.io.FileOutputStream; import java.util.ArrayList; import java.util.Collection; import java.util.List; import org.apache.poi.hssf.usermodel.HSSFCellStyle; import org.apache.poi.hssf.usermodel.HSSFSheet; import org.apache.poi.hssf.usermodel.HSSFWorkbook; import org.apache.poi.ss.usermodel.Cell; import org.apache.poi.ss.usermodel.Row; /* * Here we will learn how to create Excel file and header for the same. */ public…

Read doc file in java using poi

package com.howto; import java.io.FileInputStream; import java.io.IOException; import org.apache.poi.hwpf.HWPFDocument; /* * Here we will learn how to read a Doc file */ public class ReadDocFile { public static void main(String args[]) throws IOException { /* * Create input stream of the…