Programming in Java Question Paper

Kerala University

B.Sc Computer Science

Programming in java Question Paper

IV Semester BSc.Computer Science Degree Examination, May 2009

(2004 Scheme)




Answer any ten questions. Each question carries 3 marks.

1. Define the terms:

a) Monitor b)Package c)Interface

2. What is the difference between
Component's set Foreground (Color c) and Graphic's set Color (Color c)?

3. Write the code for computation of factorial of an integer using recursion?

4. What is the difference between overloading and overriding?

5. What is the difference between reloading and restarting an applet?

6. In one line how would you find the minimum of three values?

7. A java program creates a check box. The program is run on two different platforms. Will the button be of the same size?

8. State whether the following statements are TRUE or FALSE?
a) Switch is a java keyword
b) Final methods can be overriden
c) Abstract method can be static.

9. What does the following draw a) g.drawLine (10,10,10,50)?

10. Differentiate between thread and process?

11. Write any three swing components with an example?

12. Write all methods inside the Window Listener Interface?


Answer any five questions. Each question carries 6 marks.

1. Distinguish between Java Applications and Java Applets?

2. Define a class to implement string functions. Write a method to compare two strings.?

3. Explain any three thread methods with examples?

4. Write a program that will divide the Applet into two vertical parts. The left part contains a tree structure and the right part contains a Text Area to show your address?

5.Name any six packages with at least two classes in it?

6. Write the methods inside Mouse Listener and Mouse Motion Listener?

7. Explain the syntax of the following methods with examples?
a) drawString b) setFont c) setLayout.

8. Through a small example explain the concept of polymorphism and inheritance?

9. Write a program to display a calendar for a specified month using the data, calendar and Date format class. The program should receive the month and year from the command line?


Answer any one question. It carries 15 marks.

1. Write a simple applet program that contains labels, Textfields and Buttons to add, subtract, multiply and divide two numbers and display the result?

2. Write the Java applet that contains a textbox for accepting Student Id and a button "View Details". Single click on the button will display the details of the corresponding Student (Name, Course, Semester and Address) in text boxes from a database?

Post a Comment