Register Number
MAHENDRA INSTITUTE OF TECHNOLOGY
(AUTONOMOUS)
CONTINUOUS ASSESSMENT TEST-I
(CAT-I)
B.E-Computer Science and
Fourth Semester Regulations 2024
Engineering
CS24607 – Java Programming
Duration: 3 Hours Maximum Marks: 100
Date:16.2.26 Answer ALL Questions
20 X 1 = 20
Part- A
Marks
K
Q. No. I. Choose the best Answer M CO#
L
1. Which of the following is the main goal of Object-Oriented 1 CO1 K1
Programming?
a) Speed of execution b) Code reusability
c) Hardware control d) Memory allocation
2. In object-oriented programming, how are internal details 1 CO1 K1
hidden while exposing only functionality?
a) Inheritance b) Encapsulation
c)Abstraction d) Polymorphism
3. Java was originally developed by 1 CO1 K1
a) Microsoft b) Sun Microsystems
c)IBM d) Oracle
4. What component is used to convert Java source code into 1 C01 K1
bytecode?
a) JVM b)JRE
c)Compiler d) Interpreter
5. Which of the following is a primitive data type in Java? 1 C02 K1
a) String b)Array
c)int d) Class
Page 1 of 5
6. Identify the operator that has the highest precedence in Java. 1 C02 K2
a) Assignment b) Arithmetic
c) Unary d) Ternary
7. What statement is used to select one option from many in 1 C02 K1
Java?
a)for b)if
c)switch d)break
8. How is the flow of execution controlled in Java? 1 CO2 K2
a) if b) break
c) continue d) All of the above
9. Which keyword is used to implement an interface? 1 C03 K1
a)extends b)implements
c)import d)package
10. How many parent classes can a Java class inherit from? 1 C03 K1
a)one b)two
c)three d)four
II. Fill in the blanks
11. The Java Virtual Machine is abbreviated as ____________. 1 CO1 K1
12. A collection of objects is called a ____________. 1 CO1 K1
13. The ____________ operator is also called the conditional 1 CO2 K1
operator.
14. The process of converting one data type into another is 1 C02 K1
known as ____________.
15. Multiple inheritance is supported through ____________. 1 C03 K1
III. true or false
16. The switch statement is an example of loop control. (True / 1 CO2 K2
False)
17. Keywords are reserved words in Java. (True / False) 1 CO2 K1
18. Command line arguments are stored in the args parameter of 1 CO2 K1
the main method. (True / False)
19. An interface can contain abstract methods only. (True / False) 1 CO3 K1
20. Java supports multiple inheritance using interfaces. (True / 1 CO3 K2
False)
Answer ALL Questions
20 X 2 =40
Part-B
Marks
21. Define Object-Oriented Programming (OOP). 2 CO1 K1
Page 2 of 5
22. List any two principles of Object-Oriented Programming. 2 CO1 K1
23. Differentiate between Procedural Programming and Object- 2 CO1 K2
Oriented Programming (any two points).
24. What is JVM? State its purpose. 2 CO1 K2
25. Who developed Java and in which company? 2 CO1 K1
26. Define class and object. 2 CO1 K2
27. Give two real-world applications of Object-Oriented 2 CO1 K3
Programming.
28. What do you meant by JDK? 2 CO1 K1
29. Define an identifier. State any two rules for naming identifiers. 2 CO2 K1
30. State the meaning of type casting and identify its two types. 2 CO2 K1
31. Explain briefly about command line arguments. 2 CO2 K2
32. Define unary and binary operators with one example each. 2 CO2 K1
33. Define array. Write one advantage of using arrays. 2 CO2 K1
34. What are the Primitive datatypes?. 2 CO2 K2
35. What is the output of the following: 2 C02 K3
int a = 10, b = 5, c = 2;
int result = a + b * c - a / b + c;
[Link](result);
36. Define inheritance and mention its types. 2 CO3 K1
37. Distinguish between interface and abstract class. 2 CO3 K2
38. Write the purpose of access specifiers in Java. 2 CO3 K2
39. What is meant by multiple inheritance using interfaces? 2 CO3 K2
40. What is a package in Java? 2 CO3 K1
Part-C 4 x 10 =40
Marks
41. a) Explain the need for Object-Oriented Programming and 10 CO1 K2
discuss the principles of object-oriented languages with
suitable examples.
(Or)
b) Describe the history of Java and explain the features of 10 CO1 K2
Java programming language.
42. a) Describe operators in Java with a example program. 10 CO2 K2
(Or)
Page 3 of 5
b) Explain primitive data types, identifiers, keywords, and 10 CO2 K2
literals in Java with suitable examples.
43. a) Discuss flow control statements in Java (if, switch, for, 10 CO2 K3
while,do while) with examples.
(Or)
b) Explain arrays and command line arguments in Java with 10 CO2 K3
suitable example program.
44. a) Write a Java program to demonstrate multilevel 10 CO3 K3
inheritance by creating three classes. A base class Person
with data members name and age. A derived class
Employee that inherits from Person and adds empId and
salary. Another derived class Manager that inherits from
Employee and adds department. The program should
create an object of Manager class and display all the
details.
(Or)
b) Create two interfaces with one method each and 10 CO3 K3
implement both interfaces in a single class. Display the
output.
Page 4 of 5
Course co-ordinator HOD
Page 5 of 5