CSE2137 - Object Oriented Programming¶
I/O Programming¶
Term 151¶
- Q4(c) [4]: Write a program that counts the number of words in a text file? Consider the file name is passed as a command line argument. The program should check the file exists or not. The words in the file are separated by white space character?
Term 161¶
- Q5(a) [3]: What is Stream? Distinguish between InputStream class and Reader Class.
- Q5(b) [3]: What is random access file? How is it different from a sequential file?
- Q5(c) [5]: Write a program to read the integer values of file and save them another file after sorting.
- Q5(d) [3]: Why do you require files to store data?
Term 171¶
- Q7(d) [2+2]: Distinguish between Java InputStream and OutputStream classes? Also explain their underlying useful methods.
Term 201¶
- Q5(b) [1+3]: What is a stream? Briefly explain the three streams are automatically created in Java.
- Q5(c) [4]: Assume that you have a file name as 'outFile.txt' in your C drive. Write a program using the
java.io.FileOutputStreamclass to write the following sentence in that file: "Java programming is awesome".