OOC(18CS45) 2021
INTRODUCTION TO JAVA:
1. Describe any ten features of JAVA.
(Jan-2005, Jan-2006, Jun-2006, May-2007, Jun-09) 10Marks
2. . Explain how java is robust and interactive.(Jan-2009) 6marks
3. What is JVM? Why do we need it? (Jan-2005) 4Marks
4. Describe fundamental mechanisms of Object Oriented
Programming (May-2007) 10Marks.
5. Explain how java is robust and architectural neutral.
(Jan-2008) 8Marks
6. Explain the process of building and running java application
program (jan-2007, jun-2008) 5Marks.
7. Give the meaning of public static void main (String s[]) (jan-
2008) 4Marks.
8. What are the differences between checked and un-checked
exceptions?
9. What's the difference between abstraction and encapsulation?
(Jul-2009) 6Marks
10. What are the differences between static and dynamic
polymorphism?
11. Explain with examples the usage of: i) >>> ii) % iii) iv) >>
(Jul-2009) (Jan-2009) 8 marks
12. What is type casting? Illustrate with an example. What is
meant by automatic type promotion (jan-2006)
6Marks
13. What are the different (data) types available in java? (May-
2007) 6Marks.
Abhijit Das, Sai Vidya Institute of Technology 1
.
OOC(18CS45) 2021
14. How are arrays defined and used in Java? (May-2007)
6Marks
15. Explain the operation of the following operators with examples:
i. % ii. >>> iii. && (jan-2006) 6Marks
16. What are short-circuited logical operators? Give examples.
(May-2007) 4Marks
17. Differentiate string and string buffer class.(Jan-2009) 04 marks
18. With example, define:
i) >>> ii) << iii) ^ (Jan-2008) 6Marks
19. Describe the following control constructor with examples:
i) break ii) continue (jan-2006) 6Marks
CLASSES, INHERITANCE, EXCEPTIONS, APPLETS:
20. Explain the differences between the following with examples
i) Constructor and a method
ii) Class method and an instance method
(jan-2005) 6Marks
21. Write a java program to find the area and volume of a room. Use
a base class rectangle with a constructor and a method for
finding the area. Use its subclass room with a constructor that
gets the value of length and breadth from the base class and
has a method to find the volume. Create an object of the class
room and obtain the area and volume. (jan-2006) 8Marks
22. Explain i) Instance variables ii) Class Variables iii) Local
variables (Jan-2009) 06 marks
23. Distinguish between method overloading and method
overriding? How does java decide the method to call?
(Jan-2006, jan-2007) (jan-2008-8Marks) 6Marks
24. Explain with example class variable and instance variable.
(jun-2006) 6Marks
25. Explain the following with example.
Abhijit Das, Sai Vidya Institute of Technology 2
.
OOC(18CS45) 2021
i) Method overloading ii) Method overriding (jun-2006) 8Marks
26. Explain recursive method with a simple program.
27. How can we add two numbers using a method?
28. Compare and contrast method overloading and method
overriding with suitable examples.(Jan-2009) 08 marks
29. How can we calculate minimum, maximum and average using
Java?
30. Write short notes on
i) final class
ii) finalize
iii) Dynamic binding
iv) JVM(jan-07) 12Marks
31. Write a java program to find the distance between two points
whose coordinates are given. The coordinates can be 2-
dimensional or 3-dimensional (for comparing the distance
between 2D and a 3D point, the 3D point, the 3D x and y
components must be divided by z). Demonstrate method
overriding in this program. (May-2007) 10Marks
32. What is Instance variable hiding? How to overcome the
situation? Explain with an example. (Jan-2009) 08 marks
33. Explain with example:
i) final class ii) Abstract class (jan-2008) 6Marks
34. Write short notes on:
i) Dynamic method dispatch ii) final class iii) finalize iv) abstract
(jun-2008) 10Marks
35. What is an interface? Write a program to illustrate multiple
inheritance using interfaces. (jan-2005) 8Marks
36. What is a package? List the steps to create and invoke
packages. (Jan-2005) 6Marks
37. What are interfaces? What are their benefits? Give the general
form of a class that implements interfaces. (jan-2006)
6Marks
38. What is a package? How do we add a class to package? (jun-
2006) 6Marks
Abhijit Das, Sai Vidya Institute of Technology 3
.
OOC(18CS45) 2021
39. Describe the various forms of implementing interfaces. Develop
a program to implement multiple inheritance (jan-2007)
10Marks
40. Describe the various levels of access protections available for
packages and their implications. (jan-2007) 8Marks.
41. What is a package? What are the steps involved in creating user
defined packages? Explain with an example (jun-2008)
10Marks
42. What is the difference between the String class and String
Buffer classes in Java? Write a java program to initialize an
array of strings with the days of the week and sort the array in
ascending order. (jan-2006) (jun-2006) (jan-2008)
8Marks
43. Describe the string constructors in Java (May-2007)
10Marks
44. Describe the methods that can be used to search a sub string
in a given string (May-2007) 4Marks
45. Name the two fundamental string classes. “String class is
immutable”, comment on this statement. (jun-2008) 5Marks
46. What is an exception? Create a try block that is likely to
generate three types of exceptions and incorporate necessary
catch blocks to catch and handle them.
(Jan-2005) (Jan-2006) ((jun-2006) (jan-2008) (jun-2008)
8Marks.
47. Define exception. Demonstrate the working of nested try block
with suitable program. (jan-2007) 8Marks.
48. Give the basic form of an exception-handling block. What is the
importance of the clause finally? (May-2007) 6Marks.
49. Explain how applets are different from applications. (jan-2005)
(jun-2006) 6Marks.
50. Develop an applet that receives three numeric value form the
user and displays biggest of them on the screen. Write a HTML
page to test the applet (jan-2005) (jan-2007) 10Marks.
Abhijit Das, Sai Vidya Institute of Technology 4
.
OOC(18CS45) 2021
51. Describe 3 ways of drawing polygons (jan-2005) 10Marks.
52. What are applets? What is the order in which the applet
methods are called? (jan-2006) 5Marks.
53. Write a java program with interactive input to an applet to find
factorial of a given number. (jun-2006) 8Marks.
54. Explain the following graphics methods: draw Line, draw ARC,
and draw Polygon. (May-2007) 6Marks.
55. Give syntax for various applet tags. (jan-2008) 5Marks.
56. Do Java Support multiple inheritances? Give the justification to
your answer with an Example (Jan-2009) 6 marks
57. What is an applet? Explain different stages in the life cycle of an
applet. (jun-2008) 6Marks.
58. Define package. What are the steps involved in creating user-
defined package with an example. (Jan-2009) 6 marks
59. Write the output of the following program:
Class P2
{
public Static Void main (string ar[])
{
String S,S1;
Char Sa[ ] = new char [25];
int a =42 ;
String Buffer sb = new String Buffer (40);
Sb.append ( “a = ”).append (a).append(“f ”);
Sb.insert(0, “what is”);
S = Sb.delete (14, 15).tostring ( );
System.out.println (S);
}
}
(Jan-2009) 08 marks
t
60. Write the output of the program given below:
Class a
{
public int div( ) throws Arithmetic Exception
{
return (250/(10-10));
Abhijit Das, Sai Vidya Institute of Technology 5
.
OOC(18CS45) 2021
}
}
Class P1
{
public static void main (string a[ ] )
{
a x = new a( );
try
{
system.out.println(x.div( ));
}
catch (Exception e)
{
system.out.println(“100%”);
try
{
throw new NullPointerException (“OK”);
}
catch (Exception ae)
{
system.out.println(“Fail”);
}
}
finally {system.out.println (“pass”);}
}
} (Jan-2009) 06 marks
61. Develop an applet to create a label, a text field and 4 check
boxes with the caption “Red”,”Green”,”Blue”,”Yellow”. (jun-2008)
10Marks.
MULTI THREADED PROGRAMMING, EVENT HANDLING:
62. With a diagram, discuss about different stages of a Thread’s life
cycle. (jan-2005) 6Marks
63. What is the difference between suspending and stopping a
thread? (Jan-2009) 4 marks
64. What is synchronization? When do we use it? (Jan-2009)
3 marks
Abhijit Das, Sai Vidya Institute of Technology 6
.
OOC(18CS45) 2021
65. What are input and output streams? Explain them with
illustrations. (Jan-2009) 7 marks
66. Distinguish between multi-tasking and multi-threading? How
are synchronization and inter-thread communication done in
java? (jan-2006) 8 Marks
67. Describe the complete life cycle of a Thread with program to
illustrate yield (), stop (), and sleep () methods. (jun-2006)
8Marks.
68. Develop a program to create multithreads with different
priorities. (jan-2007) (May-2007) 8Marks
69. What is synchronization? When do we use it?
(Jan-2007) 4Marks
70. What is the need of synchronization? Explain with an example,
how synchronization is implemented in java. (jun-2008
8Marks
71. Why are wrapper classes necessary for primitive data types?
Explain the dictionary and StringTokenizer classes of java.
(Jan-2006) (jun-2008) 6Marks.
72. Define vector class. Explain vector methods. (jun-2006)
6Marks.
73. Write a Java program to implement a stack and demonstrate
push, pop, and display operations. (May-2007) 8Marks.
74. Write a note on a) Bounded buffer problems
b) Read-write problem
c) Producer-consumer problems.
75. Write a program to insert two numbers inside a stack and pop it
using utility package. (jan-2008)
8Marks.
76. How do we change the state of the Thread?
77. List and explain major tasks of input and output streams.
(jan-2005) 10Marks
78. Write a JAVA program to count the number of characters,
words and line in a given input file. (jan-2005) (jan-2006)
10Marks.
Abhijit Das, Sai Vidya Institute of Technology 7
.
OOC(18CS45) 2021
79. What are the different methods supported by input stream and
output stream classes. (jan-2007) 5Marks.
80. Write a note on AWT. (jan-2006) (May-2007) 5Marks.
81. Explain java layout managers with programs. (Jun-2006)
8Marks.
82. What are the different layouts supported by java. Write a
program to demonstrate flow layout. (jan-2007) 8Marks.
83. With example explain grid layout. (jan-2008) 5Marks.
84. Write a note on Adapter class.
85. What is inner class, illustrate with an example.
SWINGS:
86. How swing is built in AWT.
87. Explain 2-key swing features.
88. Explain the packages available in Swing.
89. WAP to create the Swing based Applet.
90. Write an applet for drawing a face. (08 marks)
91. Explain the 3 versions of the repaint method. (06 marks)
92. Explain how static and dynamic web pages are served (06 marks)
93. Explain how PLAF (Pluggable Look And Feel) is supported by
Swing.
94. What are the benefits of components and containers?
95. Mention any 6 swing packages.
96. Write a sample program to demonstrate the usage of JButton &
JToggleButton.
97. Explain the following swing buttons.
Abhijit Das, Sai Vidya Institute of Technology 8
.
OOC(18CS45) 2021
A. JButton B. JToggleButton
C. ChekBoxes D. Radio Buttons
98. How does JList differ from JscrollPane.
99. Explain the concept of JComboBox and JTable.
100. Create a class PaintPanel which draws a hexagon &
demonstrates painting directly on a panel.
101. Write a program which draws ten lines whose end points are
randomly generated on the Panel.
102. Write a program which displays the contents of an array in the
tabular format.
Abhijit Das, Sai Vidya Institute of Technology 9
.