For getting the input from the keyboard you used this line of code it will not create the error because
BufferedReader object = new BufferedReader(new InputStreamReader(System.in));
System.in is a byte stream that has no character stream features. To use Standard Input as a character stream, wrap System.in within the InputStreamReader as an argument.
InputStreamReader inp = new InputStreamReader(system.in);
In your program you used this line of code DataInputStream object =new DataInputStream (new InputStream(System.in));.....
it will create the errors like this
Factorial.java:24: java.io.InputStream is abstract; cannot be instantiated
DataInputStream object =new DataInputStream (new InputStream(System.in));
Note: Factorial.java uses or overrides a deprecated API.
Note: Recompile with -Xlint:deprecation for details.
Because InputStream class is the abstract class we can't create an instance of this class and DataInputStream is used for the following purpose .
This class is a type of FilterInputStream that allows you to read binary data of Java primitive data types in a portable way. In other words, the DataInputStream class is used to read binary Java primitive data types in a machine-independent way. An application uses a DataOutputStream to write data that can later be read by a DataInputStream.
Java Input Output Examples
Resources - http://www.roseindia.net/java/example/java/io/