How to read from a text file and print result [Java & Netbeans]

1st  package Name—> package javaapplication7;

2nd file location input.txt Namer akta file create korte hobe
package javaapplication7;

import java.util.Scanner;
import java.io.*;

/**
*
* @author AbdurRahman
*/
public class JavaApplication7 {

/**
* @param args the command line arguments
*/
public static void main(String[] args) {

java.io.File file = new java.io.File(“input.txt”);
try{
Scanner input = new Scanner(file);
while(input.hasNext())
{
String num = input.nextLine();
System.out.print(num);
}
}
catch (FileNotFoundException e)
{
System.out.print(“”);
}
}}

Code Download —->

How to read from a text file and print result [Java & Netbeans]