END TERM EXAMINATION
FOURTH SEMESTER [BCA] MAY-JUNE 2016
Paper Code: BCA-206
Subject: Java Programming
Time: 3 Hours
Maximum Marks: 75
Note: Attempt any five questions including Q.No.1 which is compulsory.
- Q1. Answer the following questions: (2.5x10=25)
- (a) How can we pass parameters to an applet?
- (b) What is the role of layout manager in AWT or Swing?
- (c) Can applet class have a constructor? Justify your answer.
- (d) What is the difference between Integer and int?
- (e) What is the purpose of the jar tool?
- (f) What do you understand by daemon thread?
- (g) Why is it illegal for static method to invoke a non-static method?
- (h) Write a note on inner classes.
- (i) State the uses of 'super' keyword with an example.
- (j) What do you understand by garbage collection in java?
- Q2. (a) What is the difference between equality of objects and equality of references that refer to them? (6)
- (b) Write an application that computes the value of following expression 'exp' using the formula: exp=1+x/1!+x2/2!+x3/3!+... (6.5)
- Q3. (a) What is the role of priorities in multithreading? What are its limitations? Explain with the help of an example how to set and get priority values for threads in Java. (5)
- (b) What do you understand by inter-thread communication in java? (5)
- (c) What is the role of stack in exception handling? (2.5)
- Q4. (a) Write a java program to accept two file names as command line argument. Copy only those lines from the first file to second which contains the word 'computer'. (8)
- (b) Discuss in detail 'throw' and 'throws' keywords. (4.5)
- Q5. (a) Explain in brief Java's event handling mechanism with the help of an example. (5)
- (b) What is a container? Explain how components are added to a container. What is a default layout of an applet? How can you change it? (4.5)
- (c) List the methods under Window Listener Interface. (3)
- Q6. (a) Swing components are lightweight components. Comment. (4.5)
- (b) What is a StringBuffer class and how does it differ from String class? (4)
- (c) Why do we need both run() and start() methods in multithreading? Can we achieve it with only run() method? Explain. (4)
- Q7. (a) Explain in detail various input and output streams and their corresponding classes in Java. (6.5)
- (b) Explain the life cycle of an applet. (6)
- Q8. Write notes on the following: (3.5, 3, 3, 3)
- (a) Interfaces
- (b) Adapter classes
- (c) Life cycle of Java Servlet
- (d) Checked Exceptions