You are on page 1of 1

Program#2.

Output Point out the error(s) and how they can be fixed
Enter (1) ouput.txt file (2) data.txt file: 55 Data Line 3 remove the sign # and insert *
not found Line 7 fixed the letter s in the word scanner and
make it capitalize S
Line 25 insert another = before the 2
Line 27 add the word File to the word
InputStream
Line 31 add letter r to the word array

Answer the following questions.


1. Why does Java use I/O streams?
The java.io package contains nearly every class you might ever need to perform input and
output (I/O) in Java. All these streams represent an input source and an output destination. The
stream in the java.io package supports many data such as primitives, object, localized characters,
etc

2. How do you write an InputStream in Java?


InputStream = Byte stream uses InputStream and OutputStream classes for input and output
operation.

3. What is FileOutputStream in Java?


The Java.io.FileOutputStream class is an output stream for writing data to a File or to a
FileDescriptor.

Activity 2(Answers)
1.A
2.A
3.B
4.A
5.A

You might also like