0% found this document useful (0 votes)
2 views3 pages

Java Model QP

This document is a model question paper for the Fourth Semester BE Degree Examination on Object Oriented Concepts with Java Programming at Mangalore Institute of Technology & Engineering. It outlines various programming tasks and theoretical questions across five modules, covering topics such as primitive data types, classes, inheritance, exceptions, and threading in Java. Students are required to answer five full questions, selecting one from each module, with a total of 100 marks available.

Uploaded by

Jyothi
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
2 views3 pages

Java Model QP

This document is a model question paper for the Fourth Semester BE Degree Examination on Object Oriented Concepts with Java Programming at Mangalore Institute of Technology & Engineering. It outlines various programming tasks and theoretical questions across five modules, covering topics such as primitive data types, classes, inheritance, exceptions, and threading in Java. Students are required to answer five full questions, selecting one from each module, with a total of 100 marks available.

Uploaded by

Jyothi
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 3

23CSPC210

MANGALORE INSTITUTE OF TECHNOLOGY & ENGINEERING


(A Unit of Rajalaxmi Education Trust®, Mangalore)
Autonomous Institute affiliated to VTU, Belagavi, Approved by AICTE, New Delhi
Accredited by NAAC with A+ Grade & ISO 9001:2015 Certified Institution

Model Question Paper


Fourth Semester BE Degree Examination
Object Oriented Concepts with Java Programming
Time: 3 Hours Max. Marks: 100
Note: 1. Answer any FIVE full questions, choosing ONE full question from each module.
2. M: Marks, L: RBT (Revised Bloom’s Taxonomy) level, C: Course outcomes.

Q.
Module1 M L C
No.
Write a program to assign a suitable value to the variable of every primitive
a (or basic data type) available in Java and print the size of each primitive data 10 L3 CO1
1 type.
Develop a JAVA program to add TWO matrices of suitable order N (The
b 10 L3 CO1
value of N should be read from command line arguments).
OR
Write a Java program that takes input from the user, asking them to enter a
month number (1-12). The program should then use a switch case to
a determine the corresponding month name and print it. If the entered month 10 L3 CO1
number is not between 1 and 12, the program should output "Invalid month
2
number."
Define an array. Write the syntax for array declaration and initialization.
b Create an array of 10 integers and initialize each array element to a random 10 L3 CO1
value between 1 10 (both inclusive)
Module 2
Differentiate between “Class” and “Object”. Write a java program to define
a a class named car with attributes (brand, model, year), a constructor to 10 L3 CO2
initialize the object, and a method to display information about the car.
3
What is the meaning of a final variable, a final method, and a final class in
b Java? Design a Final Java class that cannot be extended. This should have a 10 L3 CO2
final method getCircumference() which returns the circumference for the

Page 1 of 3
23CSPC210
given radius as its input and uses the Final mathematical constant PI defined
in the same class to compute the same.
OR
What is method overloading and constructor overloading? Write a program
a 10 L3 CO2
to demonstrate method overloading based on number of parameters
Design a class hierarchy – The base class is Animal, the derived class is
Dog, and the third class is the test class. The base has a private data member
4
name and an abstract protected method makeSound() which is dummy. Dog
b 10 L3 CO2
defines a concrete body for this method (barking). The test class instantiates
a dog object and tests all of the above – printing the name of the dog (with
a public method in the class Animal) and the sound it makes.
Module 3

a Define Inheritance. Write a program to explain the Multilevel hierarchy 10 L3 CO3


5
b Discuss i) Super and ii) abstract class with examples 10 L3 CO3
OR
What is method overriding? Explain how it allows Java to support run-time
a 10 L3 CO3
polymorphism with a very simple example.
6
What is Interface? What are its benefits? Write a program and Explain how
b 10 L3 CO3
Interface is implemented in java.
Module 4
Define Exception. Write a program which contains one method which will
a throw IllegalAccessException and use proper exception handlers so that 10 L3 CO4
exception should be printed in the calling function.
Create two packages, package1 and package2. In package1, define a class
7
with members having public, protected, default, and private access modifi-
b ers. In package2, create another class to import and access the members of 10 L3 CO4
the class from package1. Write a Java program to demonstrate which
members can be accessed and explain the output.
OR
What is checked and uncheck exception? Write a java program to illustrate
a 10 L3 CO4
Nested try catch statement
Write a Java program to demonstrate chained exceptions. Create a scenario
8 b 10 L3 CO4
where an initial exception causes another exception to occur
Module 5

Page 2 of 3
23CSPC210
What is Thread? Write a sample program and explain two different ways
9 a 10 L3 CO5
of creating a Thread in Java.
Define a class with three threads, first with a minimum priority, second
with a normal priority, and a final one with maximum priority. Use the in-
b 10 L3 CO5
built priorities from the Java Thread class. Each thread should print its
name, priority, and exit.
OR
Implement a method that accepts both primitive and wrapper types as argu-
10 a ments, showcasing autoboxing and unboxing in expressions and method 10 L3 CO5
calls
Use type wrapper classes (Character, Boolean, and numeric type wrappers)
b 10 L3 CO5
to create objects, perform operations, and display their values.

Page 3 of 3

You might also like