Skip to content

Instantly share code, notes, and snippets.

@sjsakib
Created April 21, 2016 22:19
Show Gist options
  • Save sjsakib/941505de35f777d05fb5294eebaf7f10 to your computer and use it in GitHub Desktop.
Save sjsakib/941505de35f777d05fb5294eebaf7f10 to your computer and use it in GitHub Desktop.
import java.util.*;
import java.io.*;
public class InputWithFile {
public static void main(String[] args) throws Exception {
System.setIn(new FileInputStream(new File("in")));
Scanner in = new Scanner(System.in);
System.out.println(in.next());
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment