Roll No.
223
IET, Dr. ShakuntalaMisra National Rehabilitation University, Lucknow,
Department of
SessionalTest - 1
Sem& Year: 5th&3rd Session: 2023-2024
Subject: 00P WITH JAVA Code: TCS-502
Duration: 90 Minutes Max. Marks: 20
PartA
Attempt allquestions Attenpt allquestions (1x5=5 Marks)
1. What is encapsulation in java ?
a) The process of combining data and method into a single unit
b)The process of hiding dataand methods within a class
, c)The process of creating multiple instance of a class
d) The process of reusing code from existing classes
2. What is inheritance in java ?
a)The process of creating multiple instances of aclass
c) The process of hiding data and methods within aclass
d) The process of reusing code from existing classes
b)The prOcess of of combining data and methods into a single unit
3. What is the difference between method overloading and method overriding in java?
a) Method overloading occurs within the same class while method overriding occurs
between different classes
b) Method overloading involves creating multiple methods with the same name but
different parameters while method overriding involves providing a different
implementation for an inherited method
c) Method overloading is a compile time polymorphism concept while method
overriding is a runtime polymorphism concept
d) All of the above
4. What is polymorphism in java?
C
a) The ability of a class to inherit properties and behaviors from another class
b) The process of hiding data and methods within a class
c) The process of creating multiple instances of a class
hour
d)The ability of an object to take on many forms
5. What are abstract classes in java?
a) Classes that cannot be instantiated
b)Classes that can be used as blueprints for creating objects
c) Classes that only contain abstract methods
d) Allof the above
Part B
Attempt any Five Questions (2x5-10 Marks)
1. What is the significance of the CLASSPATH environment variable
increating/using a package?
2. Describe the process of importing and accessing a package with
suitable examples.
3. Write the benefits of packages and interfaces
4. How to define a package in java?
5. Define exception.
6. Define basic characteristic of object oriented
programming.
Part C
Attempt any one Questions (5x1=5 Marks)
1. What is the purpose of constructor in java programming
2.How is exception handled in java?
SEMESTER EXAMINATION, DECEMBER -2022
Course Name :- B. Tech (CSE) Semester:- 5th
Paper Name :- Qbjeot Oriented Programming with fava Paper Code:- TCS - 502
Time - 2Hrs + 20 minutes per hour extra time for V.I. & examinees with
writer. Max Marks - 70
3rfecocH 305- 70
Instructions:
The question paper consists of three sections namely A, B, C. All
Section A- Each question carries04 marks. All questions are sections are compulsory.
Section B- Answer any 2 out of 4 given questions in maximum compulsory.
carries 10 marks. hundred (150) words. Each question
Section C- Answer any 2 out of 3 given questions in maximum five
question carries 15 marks. hundred (250) words. Each
Section - A(gug - 31)
Objective Questions (HggHA)
1. Answer allthe following questions.
5x4 =20
I) Which option is false about the final
a) A final method cannot be keyword?
b) A final class cannot be overridden in its subclasses.
extended.
c)Afinal class cannot extend other
d)A final method can be inherited. classes.
II) Allthe classes in java.lang package are
a)True automatically imported when a program is compiled.
b)False
III )Which component is used to
a) JRE compile, debug and execute the java programs?
b) JIT
c) JDK
d) jVM
IV) Which method of the
Class.class is used to determine the name ofa class
class object as a String?
a)getClass()
represented by the
b) intern)
c) getName).
d) toString)
V) Which component isresponsible for
a) JVM converting bytecode into machine specific code?
b) JDK
c) JIT
d) JRE
Section - B( qS - 4)
Short Answer Questions ( HysTYwT)
2. Answer any two of the following questions in maximum 150 words. 10 x 2 = 20
1. Explain member level access modifiers. Take appropriate examples.
2. (a) What are varioustop level class access modifier. Explain any three. Take appropriate examples.
QR
(b )write a java program to create an abstract class named "Shape" that contains two integers and an
empty method named printArea( )and getValuest ). Provide three classes named Rectangle, Triangle and
Circle such that each one of the classes extends the class Shape. Each one of the classes contains the method
getValues() respective values and printArea() that prints the area of the given shape.
3. Explain Object Type casting in detail with example.
4. Differentiate between new and newinstance(). Take appropriate example.
Section -C(g- H)
Descriptive Questions (feRUISHAHRT)
3. Answer any two of the following question in maximum 250 words. 2x15=30
1, Explain Object Oriented features. Take appropriate example.
2. Define Constructors. Explain various types of constructors in java with exaiiple.
3. (a ) Write a class 8tudent having details: name, registration
number, father's name, address, email, and
mobile number. UG8tudent, PGStudent, extend the student class. They have
details about the past
qualifying degree and marks. Make each attribute private and provide suitable getter
and setter to access
attributes. Add a method to print student details using a student's registration number.
QR
(b)Explain Coupling and Cohesion in detail.
Page 2 of 2
SEMESTER EXAMINATION DECEMBER-2023
Course Name: -B.TECH Semester:-V
Paper Code:-TCS-502
Paper Name: -0OP WITHJAVA
examinees with writer. Max Marks-70
Time- 3 Hrs + 20 minutes per hour extra time for V.I. &
3rfeprH 35-70
Instructions:
" The question paper consists of three sections namely A, B, C. All sections areecompulsory.
" Section A- Each question carries 3 mark. All questions are compulsory.
Section B- Answer any 5 out of 7 given questions in maximum one hundred fifty (150)
words. Each question carries 7 marks.
SectionC- Answer any 2 out of 3 given questions in maximum three hundred (300) words. Each
question carries 10 marks.
Section-A (Tug )
Objective Questions(gt-gT9)
1. Answer allthe following questions. 5x3 =15
i) What is encapsulation in java?
a) The process of combining data and method into a single unit
b) The process of hiding data and methods within a class
c) The process of creating multiple instance of a class
d) The process of reusing code from existing classes
ii) What is inheritance in java ?
a)The process of creating multiple instances ofa class
b)The process of hiding data and methodswithin aclass
c) The process of reusing code from existing classes
d) The process of of combining data and methods into a single unit
ii) What is the difference between methodoverloading and methodoverriding in java?
a) Method overloading occurs within the same class while method overriding occurs
between
different classes
b) Method overloading involves creating multiple methods with the same name but different
parameters while method overriding involves providing a different implementation for an
inherited method
c) Method overloading is a compile time polymorphism concept while method overriding is a
runtime polymorphism concept
d) Allof the above
iv) What is polymorphism in java?
behaviors from another class
a) The ability ofa class to inherit properties and
class
b) The process of hiding data and methods within a
c) The process of creating multiple instances of a class
) The ability of an object to take on many forms
v) What are abstract classes in java?
ja) Classes that cannot be instantiated
b) Classes that can be used as blueprints for creating objects
c) Classes that only contain abstract methods
d) Allof the above
Section - B(qug-a)
Short Answer Questions( y s 4y)
2. Answer any five of the following questions in maximum150 words. 5x7=35
i. What is the significance of the CLASSPATH environment variable in creating/using a package?
ii. Define basic characteristic of object oriented programming. -
iii. Write an applet code to demonstrate paameter passing to applet.
iv. What is the difference between multitasking and multithreading?
V. Explain the AWT class hierarchy.
vi. Explain event handling in java.
vii. Write a java program for simple chatting using TCP,
Section -C(qug-H)
Descriptive Questions (yIGHOAYA)
3. Answer any two of the following question in maximum 300 words. 2x10=20
i) Define TCP server socket and TCP client socket with example.
iü) What is servlet ? Explain the life cycle of a servlet.
ii) Define and explain exception handling in java.