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 ReadTheFileUsingScanner { public static void main(String[] args) { Scanner scanner = new Scanner(System.in); System.out.println("Enter the… Continue reading
Posts in "Code Base"
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 to read the file using BufferedInputStream. */ public class ReadTheFileUsingBufferedInputStream { @SuppressWarnings("deprecation") public static void… Continue reading
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 if the string argument is not null and is * equal(Ignoring case) to the string… Continue reading
Split a String Using scannner Class in Java
In this article we will learn to split the string using Scanner Class.
How to split a string in java using stringtokenizer
Here we will learn to split the String in parts on the basis of tokens provided.
How to sort list of String or Integer in java
Here we will learn to code how to sort a List of Integer and String.
How to add or subtract datetime in java with examples
Here we will learn how to add or subtract date time from given date.
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 class CreateExcelFile { int rownum = 0; HSSFSheet firstSheet; Collection<File> files; HSSFWorkbook workbook; File exactFile;… Continue reading
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 doc file – Provide exact path of the doc * file to read */ FileInputStream… Continue reading
Read and Write Excel with Java using PoI
In this tutorial we will learn how to Create and / or read Excel file with Java. To perform this action we will use POI project from apache.