II B.Tech I Sem (MR-21) OOPS Objective Types Questions Bank
II B.Tech I Sem (MR-21) OOPS Objective Types Questions Bank
II B.Tech II Semester (MR22 2022-23 Batch) Mid Term Examinations-I, April 2024
Subject Code & Name: - Object Oriented Programming (C0511) Max. Marks: 20
Branch: CSE (AI and ML)
Answer ALL the Questions:
S.No Question Answer
Which of the following option leads to the portability and security of Java. A
4 a.Yes b.No
c. Compilation Error d.Runtime Error
7 a.if b.switch
Which of the following loops will execute the body of loop even when condition B
controlling the loop is initially false?
What is the output of the below Java code snippet? int[] balls = {}; A
System.out.println(balls.length);
18
a.0 b.-1 c.1 d. compile error
19 System.out.println(ages[1]);
what is a variable? A
d.instance of a class
26 what is an expression? A
a.An expression is a sequence of operands and operators
28 a.to determine the relationship b.to compare bit level c.Both above.
d.none
b.among different paths, only one path gets executed based on the condition
35 b.among different paths, only one path gets executed based on the condition
what is an array? A
What is default access specifier for data members or member functions declared D
within a class without any specifier in java
42
a.Private b.Protected c.Public d.no access modifier
Java is invented by C
Evaluate the following Java expression, if x=3, y=5, and z=10: ++z + y - y + z + D
x++
45
a.24 b.23 c.20 d.25
c.The destination type can be larger or smaller than source type d.None of the
mentioned
If an expression contains double, int, float, long, then the whole expression will C
be promoted into which of these data types?
49
a.long b.int c.double d.float
polymorphism means B
53 a.aquiring the properties of other object b.ability to take more than one form.
c.both d. none
56 a.Its name must be same as that of class b.It must not have any return type
In which access should a constructor be defined, so that object of the class can be A
created in any function?
57
a.public b.protected c.private d.any access specifier
60 a.same b.different c.Same but using superclass or subclass types also work
d.none
To successfully overload a method in Java, the argument-list or parameter-list B
must be
61
a.same b.different c.same or different d.none
what is a class? D
65 Constructor is like A
a. Method b. a class c. an object d. none
If super class and subclass have same variable name, which keyword should be C
87 used to use super class?
A
Does Java support multiple level inheritance through classes?
88
a.TRUE b.FALSE c.all d.none
a.If a subclass uses a method that is already provided by its parent class, it is
known as Method Overriding.
Which is the correct way to inherit and implement the interface? Consider an A
example,
d.None
Which of these is a mechanism for naming and visibility control of a class and its B
116 content?
a.Object b.Packages c.Interfaces d.None of the Mentioned
Which of this access specifies can be used for a class so that its members can be C
117 accessed by a different class in the same package?
Which of these access specifiers can be used for a class so that its members can A
118 be accessed by a different class in the different package?
Which of the following is the correct way of importing an entire package ‘pkg’? C
119
a.import pkg b.Import pkg c.import pkg.* d.none
d.A package can be renamed without renaming the directory in which the classes
are stored
Which of the following package stores all the standard java classes? A
121
a.lang b.java c.util d.java.packages
Which of the following packages is used to includes utility classes like Calendar, D
122 Collection, Date?
Which of the following package stores all the standard java classes? A
125
a.java.lang b.java.util c.java.io d.java.system