Register Number
MAHENDRA INSTITUTE OF TECHNOLOGY
(AUTONOMOUS)
Model Examinations -I – April/May 2025
B.E/[Link]-
Fourth Regulations
AUTO,AI&ML,CSE,EEE,ECE,IT,MEC
Semester 2022A
H
CS2210401 – JAVA PROGRAMMING
Duration: 3 Hours Maximum Marks: 100
Answer ALL Questions
PART – A (20x1=20)(One mark questions)
[Link]. I. Choose the best Answer CO# KL
1 Which package contains the Random class?
A) [Link] package B) [Link] package CO1 K1
C) [Link] package D) [Link] package
2 What is an object in Java?
A) A keyword used for inheritance B) An instance of a class
CO1 K1
D) A variable declared within a
C) A primitive data type
method
3 Which keyword is used to achieve encapsulation in Java?
A. this B. super CO2 K1
C. private D. static
4 Which of the following is true about interfaces in Java?
A. Interfaces can contain constructors B. Method overriding CO2 K1
C. Interfaces can have method D. None of the above
implementations
5 Which of these is a mechanism for naming and visibility control of a class and
its content?
A) Object B) Packages CO3 K1
C) Interfaces D) None of the Mentioned.
6 Which of the following package stores all the standard java classes?
A) lang B) java CO3 K1
C) util D) [Link]
7 Which of these keywords must be used to handle the exception thrown by try CO4 K1
block in some rational manner?
A) try B) finally
Page 1 of 4
C) throw D) catch
8 When does Exceptions in Java arise in code sequence?
A) Run Time B) Compilation Time CO4 K1
C) Can Occur Any Time D) None of the mentioned
9
Which of the following is a mutable class in java?
A) [Link] B) [Link] CO5 K1
C) [Link] D) [Link]
10
When is the object created with new keyword?
A) At Runtime B) At compile time CO5 K1
C) Depends on the code D) None
II. Fill in the blanks
11 _______ Is used to find and fix bugs in the Java programs. CO1 K1
Father of Java Programming Language is_______
12 objects CO2 K1
13 Methods defined in an interface must be _______ CO3 K1
14 _______ Command is used as the Java interpreter. CO4 K1
Java byte code output from the JDK compiler will be placed into a file
15 CO5 K1
with ---------- extension.
III. True or False
16 Instance variables are declared outside a class. CO1 K1
17 Methods defined in an interface must be private. CO2 K1
18 Multiple Inheritance not supported by java. CO3 K1
19 An exception is an object that is generated when a runtime error occurs. CO4 K1
Ifaclassdefinitiondoesnotexplicitlyputaclassintoapackage,theclassbelongstothe
20 CO5 K1
default package.
PART – B (20x2=40)( Two mark questions)
21 What are the different types of operators used in Java? CO1 K1
22 Define Inheritance. CO1 K1
23 How Java supports platform independency? CO1 K2
CO1
24 What is the difference between Method overloading and Method overriding in K2
Java?
Page 2 of 4
CO2
25 What are primitive data types in Java? K2
26 How many expressions are there n Java? CO2 K1
1.
27 What is the difference between unary and ternary operator in Java? CO2 K2
28 Which construct is used to define an array? CO2 K2
29 What is a abstract class in Java and interface? CO3 K1
30 Which package is used for exception in Java? CO3 K2
31 How to create an exception interface in Java? CO3 K1
32 What is enrichment in Java? CO3 K1
33 What is called thread in Java? CO4 K1
34 What are three methods of synchronization? CO4 K1
35 How to read and write multiple files in Java? CO4 K2
36 What is a real example of multithreading in Java? CO4 K1
37 What is network programming in Java? CO5 K1
38 What are threads in concurrent programming? CO5 K2
39 Which class is used to create TCP server? CO5 K1
40 What are client and server in java? CO5 K1
PART – C(4x10=40) (10 Marks questions)
41. a) Illustrate with examples of looping statements.
CO1 K2
OR
41. b) Explain the Installation of the JDK on Microsoft Windows Platforms. CO1 K2
42. a) Discuss the Arrays in java program in detail CO2 K2
OR
Demonstrate in detail about the Java Exceptions with suitable java program.
42. b) CO3 K2
Describe the concept of Multithreading in Java.
43. a) CO4 K3
OR
Page 3 of 4
43. b) Explain the Synchronization in Java with an example. CO4 K2
44. a) Describe the Socket Programming in Java .with a suitable program. CO5 K3
OR
44. b) Explain in detail about the TCP/IP with example. CO5 K3
Course co-ordinator HOD
Page 4 of 4