affiliate marketing

Thursday, 7 June 2012

JAVA PROGRAMMING QUESTION BANK PART 4

Unit-4

1. What is a thread?
2. What is the difference between multiprocessing and multithreading?
3. What is to be done to implement multithreading in a program?
4. What java interface must be implemented by all threads?
5. How to start a thread?
6. What are the 2 methods by which we may stop threads?
7. Difference between Suspending and stopping a thread?
8. How do we set priorities for threads?
9. Describe in brief the complete lifecycle of a thread?
10. What is synchronization? When do we use it?
11. Give some real life situations that illustrate the use of multithreading?
12. What is a file? Why do we require files to store data?
13. What is a stream? How is the concept of Streams used in Java?
14. What are I/P & O/P Streams?
15. What is Stream class?
16. How are the stream classes classified?
17. Describe in brief the major tasks of input and output stream classes?
18. Compare Input stream and Reader classes?
19. Distinguish between Output Stream and Writer classes?
20. Describe the functions of the FILE class?
21. What are the most commonly used classes for handling I/O related exceptions?
22. State the steps involved in writing a disk file?
23. What is meant by initializing a file stream object? Give examples?
24. Which streams must always be used to process external files? Why?
25. What is a random access file? Why do we need it?
26. Compare random access file & Sequential file?
27. Create a Data Input Stream for the file name “Student.dat” files?
28. Create a Random Access file stream for the file “student.dat” for uploading the student information in the file?
29. Write statements to create a file stream that concatenates 2 existing files?
30. Can we open an existing file for writing? If not why?
31. How would we check whether a file to be opened for writing already exists?
32. While reading a file how would we check whether we have reached file end or not?
33. Write statements to create data streams to read primitive data from a file?
34. Write code to write Primitive data to a file?
35. Describe through appropriate statements how a double type value is read from the keyboard interactively?
36. Why should the sleep () method of thread class be enclosed in a try catch block?
37. What is a single threaded Program?
38. What are Light Weight Processes?
39. What are the values of the priority constants a. MIN_PRIORITY b. NORM_PRIORITY c. MAX_PRIORITY
40. When a deadlock may occur in multithreading?

Ten Marks

1. Explain Creating a thread, extending the thread class and an example of using the thread class?
2. Describe the life cycle of a thread?
3. Explain the use of thread methods such as yield(),stop() and sleep().
4. Explain thread priority with suitable examples?
5. What are the 2 ways of creating threads? Explain with suitable programs?
6. Explain about synchronization in threads?
7. Explain Inter thread Communication and suspending, resuming and stopping threads?
8. Show how to read from and write to console with suitable examples?
9. Show how to read from and append to another file with suitable examples?
10. Describe the byte stream class?
11. Explain about concatenating and buffering files?
12. How to handle primitive data types using the I/O package .Give suitable examples?
13. Explain character stream classes?
14. Explain the concept of streams and about stream classes and classification?
15. Give suitable examples to read from and write bytes to a file?



No comments:

Post a Comment