END TERM EXAMINATION
Fourth Semester - BCA
Paper Code: BCA-2016
Subject: Java Programming
Time: 3 Hours Maximum Marks: 75
Note: Attempt any five questions including Q No. 1 which is compulsory
Question 1: Answer the following questions: (2.5 x 10 = 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 purpose of the jar tool?
(e) What is the difference between Integer and int?
(f) Why is it illegal for static method to invoke a non-static method?
(g) What do you understand by daemon thread?
(h) State the uses of 'super' keyword with an example.
(i) Write a note on inner classes?
(j) What do you understand by garbage collection in java?
(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 the following expression 'exp' using the formula:
exp =1 + x/1! + x²/2! + x³/3! +... (6.5)
(a) What is the role of priorities in multi-threading. 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)
(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 work 'computer'. (8)
(b) Discuss in detail 'throw' and 'throws' keywords. (4.5)
(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 the default layout of an applet? How can you change it? (4.5)
(c) List the methods under Window Listener Interface? (3)
(a) Swing components are lightweight components. Comment. (4.5)
(b) What is a String Buffer class and how does it differ from String class? (4.5)
(c) Why do you need both run() and start() methods in multi-threading? Can we achieve it with only run() method? Explain. (4)
(a) Explain in detail various input and outpur streams and their corresponding classes in Java. (6.5)
(b) Explain the life cycle of an applet. (6)
Write notes on the following:
(a) Interfaces (3.5)
(b) Adapter classes (3)
(c) Life cycle of a Java Servlet (3)
(d) Checked Exceptions (3)