Remid Question Bank-OOPJ
Remid Question Bank-OOPJ
Remid Question Bank-OOPJ
Unit-7: Multithreading
1. Explain Thread life cycle.
2. What is multithreading? What are the ways in which you can create a thread? Explain it with
example.
3. Explain Thread class and its methods (static and instance) with example.
4. List and explain methods for Inter-thread communication (cooperation).
5. Explain two usage of keyword synchronized.
Unit-8: IO Programming
6. Discuss Byte Stream and Character Stream class.
7. Explain File class and its methods with example.
8. Explain FileInputStream and FileOutputStream class and its methods with example.
9. Explain FileReader and FileWriter class and its methods with example.
10. Differentiate : Text I/O and Binary I/O
Unit-11 to Unit-15:
33. Draw class diagram with the help of an example.
34. Draw use case diagram with the help of an example.
35. Draw activity diagram with the help of an example.
36. Draw state diagram with the help of an example.
37. Draw sequence diagram with the help of an example.
Sample Programs from GTU papers:
1. Write a program for producer-consumer problem using Thread concept.
2. Write a program that reads file name from user, through command line argument or from user and
displays/reads content of the text file on console.
3. Write a program that accepts name of website from user, and displays IP address of it on console.
4. Create a class called Student. Write a student manager program to manipulate the student
information from files by using the BufferedReader and BufferedWriter.
5. Write a program that reads a file and counts the number of occurrences of digit 5. Supply the file
name as a command-line argument.
6. Write a program to create two thread one display alphabet from a to z and other will display
numbers from 1 to 100.
7. Write a program that counts number of characters, words, and lines in a text file.
8. Write a program to check whether the name given from command line is file or not. If it is a file
then print the size of a file and if it is a directory then it should display the name of all files in it.
9. Write a program using BufferedInputStream, FileInputStream, BufferedOutputStream,
FileOutputStream to copy content of one file Test1.txt into another file Test2.txt.
10. Write a program to create two threads, one thread will check whether given number is prime or not
and second thread will print prime numbers between 0 and 100.
11. Write a program which read source file and destination file name and copy the content of source
file to destination file.
12. Write a program that executes two threads. One thread displays "Welcome" every 1000
milliseconds & another thread displays "Good Bye" every 5000 milliseconds. Create the threads by
implementing the Runnable interface.
13. Write a program to implement a singly linked list with nodes storing integer information using
suitable utility class.
14. Write a program to replace all “word1” by “word2” to a file without using temporary file and
display the no. of replacement.
15. Write a program that executes two threads. One thread displays "Good Morning" every 1000
milliseconds & another thread displays "Good Afternoon" every 3000 milliseconds. Create the
threads by implementing the Runnable interface.
16. Write a program to read employee salary and calculate the income tax based on 10% of income and
store it in tax.txt file for five different employees.
17. Write a program which read numbers from number.txt file and store even number to even.txt and
odd number into odd.txt file.