Model Question Paper 1
Model Question Paper 1
Note: Answer any FIVE full questions, choosing one full question from each module.
Module-1
b. Explain the various primitive data types used in Java. Give suitable examples.
(8 Marks)
c. What is type casting? Illustrate with an example, what is meant by automatic type
casting? (4 Marks)
OR
2. a. Define an array. Write the array declaration syntax for one dimensional and
multidimensional array with example. (8 Marks)
b. List out and explain the different looping statements used in Java with syntax and
examples. (8 Marks)
c. Write a Java program to sum only first five elements of the array using for each loop.
(4 Marks)
Module-2
3. a. What is class? How to define class in Java? Explain with syntax and examples. (8 Marks)
b. Write a Java program to create a class called stack and implement all the operations on
stack using different methods. (8 M Marks)
OR
Module-3
5. a. What are super class constructors? How does super class members are used in Java.
(10 Marks)
b. What is method overriding? Explain how it allows Java to support run-time polymorphism
with an example. (10 Marks)
OR
6. a. Develop a JAVA program to create an abstract class Shape with abstract methods
calculateArea() and calculatePerimeter(). Create subclasses Circle and Triangle that extend the
Shape class and implement the respective methods to calculate the area and perimeter of each
shape. (10 Marks)
b. What is interface? How to implement interface in Java? Explain with suitable examples.
(10 Marks)
Module-4
7. a. Describe the various levels of access protections available for packages and their
implications. (8 Marks)
c. Develop a JAVA program to raise a custom exception (user defined exception) for
DivisionByZero using try, catch, throw and finally. (8 Marks)
OR
8. a. Define package. Explain the creation of package with suitable example program. (8 Marks)
9. a. What is Thread? Explain two ways of creation threads in Java with examples. (10 Marks)
OR
10. a. With syntax and examples, explain the use of isAlive( ) and join( ) methods. (10 Marks)
b. Write a program to illustrate creation of threads using runnable class. (start method start
each of the newly created thread. Inside the run method there is sleep() for suspend the thread for
500 milliseconds). (10 Marks)