0% found this document useful (0 votes)
41 views

Java Mid 1

Uploaded by

Sabeer
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)
41 views

Java Mid 1

Uploaded by

Sabeer
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/ 14

4/28/22, 11:51 AM R2022054

001. ................are not machine instructions and therefore, Java interpreter generates machine code A
that can be directly executed by the machine that is running the Java program.
A byte code B Java mid code
C Compiled code D Compiled Instructions
002. How many times does the following code segment executeint x=1, y=10, z=1; do { y; x++; y-=2; D
y=z;z++; } while (y>1 && z<10);
A 10 B 5
C 3 D 1
003. A compiler converts the java program into an intermediate language representation B
called____________.
A byte B byte code
C Byte class D Byte java
004. Command to execute compiled java program is --------- A
A java B javac
C run D javaw
005. The command javac is used to --------------- C
A debug a java program B interpret a java program
C compile a java program D execute a java program
006. Which of these jump statements can skip processing the remainder of the code in its body for a B
particular iteration?
A break B continue
C return D exit
007. Which feature of OOP encourages the code reusability? D
A encapsulation B abstraction
C polymorphism D inheritance
008. Who is known as father of Java Programming Language? A
A James Gosling B M. P Java
C Charel Babbage D Blais Pascal
009. Which of these are selection statements in Java? A
A if() B for()
C continue D break
010. Which operator is used to invert all the digits in a binary representation of a number? A
A ' B <<<
C >>> D ^
011. Which of the following can be operands of arithmetic operators? D
A Numeric B Boolean
C Characters D Both Numeric & Characters
012. Which right shift operator preserves the sign of the value? B
A << B >>
C <<= D >>=
013. Which of these operators can skip evaluating right hand operand? B
A & B &&
C | D !
014. Which provides runtime environment for java byte code to be executed? B
A JDK B JVM
C JRE D JAVAC
015. In java control statements break, continue, return, try-catch-finally and assert belongs to ---------- C
-----?
file:///C:/PHD/JNTUK ONLINE/ONLINE EXAMS/jntuonlinecrack/banksdecrypted/R2022054/R2022054.html 1/14
4/28/22, 11:51 AM R2022054

A Selection statements B Loop Statements


C Transfer statements D Pause Statement
016. Which of this statement is incorrect? B
A switch statement is more efficient than a B two case constants in the same switch can
set of nested ifs have identical values
C switch statement can only test for D it is possible to create a nested switch
equality, whereas if statement can statements
evaluate any type of Boolean expression
017. What is the full form of JVM ? C
A Java Very Large Machine B Java Verified Machine
C Java Virtual Machine D Java Very Small Machine
018. What is byte code in Java? A
A Code generated by a Java compiler B Code generated by a Java Virtual Machine
C Name of Java source code file D Block of code written inside a class
019. What is true about do statement? A
A do statement executes the code of a loop B
do statement does not get execute if
at least once condition is not matched in the first
iteration
C do statement checks the condition at the D do statement executes the code more than
beginning of the loop once always
020. Which of the following is not a valid flow control statement? A
A exit() B break
C continue D return
021. What is the output of this program? classmainclass { publicstatic voidmain(String args[]) { chara C
= 'A ' a++; System.out.print((int)a); } }
A 67 B 65
C 66 D 64
022. From where break statement causes an exit? D
A Only from innermost loop B Terminates a program
C Only from innermost switch D From innermost loops or switches
023. Which of these statements are incorrect? D
A The left shift operator, <<, shifts all of the B The right shift operator, >>, shifts all of
bits in a value to the left specified number the bits in a value to the right specified
of times number of times
C The left shift operator can be used as an D The right shift operator automatically fills
alternative to multiplying by 2 the higher order bits with 0
024. Which of the following is not a valid jump statement? B
A break B goto
C continue D return
025. What is true about a break? A
A Break halts the executionand forces the B Break stops the executionof entire
control out of the loop program
C Break forces the controlout of the loop D Break halts the executionof the loop for
and starts the execution of next iteration certain time frame
026. Which of the following are not Java keywords ? C
A double B switch
C then D instance of
027. With x = 0, which of the following are legal lines of Java code for changing the value of x to 1? C
1. x++; 2. x = x + 1; 3. x += 1; 4. x =+ 1;
A 1, 2 & 3 B 1&4
file:///C:/PHD/JNTUK ONLINE/ONLINE EXAMS/jntuonlinecrack/banksdecrypted/R2022054/R2022054.html 2/14
4/28/22, 11:51 AM R2022054

C 1, 2, 3 & 4 D 3&2
028. Which of the following is used with the switch statement? C
A Continue B Exit
C break D do
029. Which of the following is not a valid jump statement? B
A break B goto
C continue D return
030. Evaluate the following Java expression, if x=3, y=5, and z=10: ++z + y - y + z + x++ A
A 24 B 23
C 20 D 25
031. Which of these statements are incorrect? D
A The left shift operator,<<, shifts all of the B The right shift operator,>>, shifts all of
bits in a value to the left specified the bits in a value to the right
numberof times specifiednumber of times
C The left shift operatorcan be used as an D The right shift operatorautomatically fills
alternative to multiplying by 2 the higher order bits with 0
032. What is the output of this program? classOutput { publicstaticvoidmain(String args[]) { intx , y; C
x = 10; x++; --x; y = x++; System.out.println(x + " " + y); } } (
A 11 11 B 10 10
C 11 10 D 10 11
033. Which of the following is not a valid flow control statement? A
A exit() B break
C continue D return
034. What is the output of this program? classincrement { publicstaticvoidmain(String args[]) { intg = B
3; System.out.print(++g * 8); } }
A 25 B 32
C 24 D 33
035. Which of the following is not a Java features? A
A Use of pointers B Dynamic
C Architecture Neutral D Object-oriented
036. _____ is used to find and fix bugs in the Java programs D
A JVM B JRE
C JDK D JDB
037. Single line comment starts with _________ in Java. D
A /** B **
C /* D //
038. What is the output of Compilation of Java Program? B
A .cla file B .class file
C .jc file D .javax file
039. Byte code is the result of? A
A Compiling a Java file B Compiling a Class file
C Interpreting a Java File D Interpreting a Class file
040. A valid Identifier or name in Java language can start with which character? C
A a-z, A-Z B $, _
C A and B D 0-9
041. Which of these have highest precedence? A
A () B ++
C * D >>
file:///C:/PHD/JNTUK ONLINE/ONLINE EXAMS/jntuonlinecrack/banksdecrypted/R2022054/R2022054.html 3/14
4/28/22, 11:51 AM R2022054

042. What is the file name extension of a Java source program? B


A .ja B .java
C .j D ,jax
043. What is the output of relational operators? B
A Integer B Boolean
C Characters D Double
044. Which of the following loops will execute the body of loop even when condition controlling the A
loop is initially false?
A do-while B while
C for D if
045. Which of the following for loop declaration is not valid? C
A for ( int i = 7; i <= 77; i += 7 ) B for ( int i = 20; i >= 2; - -i )
C for ( int i = 99; i >= 0; i / 9 ) D for ( int i = 2; i <= 20; i = 2* i )
046. Which component is used to compile, debug and execute Java program? B
A JVM B JDK
C JIT D JRE
047. Which of the following statement is incorrect? B
A switch statement is moreefficient than a B two case constants in thesame switch can
set of nested ifs have identical values
C switch statement can onlytest for equality, D It is possible to createa nested switch
whereas if statement can evaluate any statements
type of booleanexpression
048. Which of these jump statements can skip processing the remainder of the code in its body for a D
particular iteration?
A break B return
C exit D continue
049. Which of these is not a bitwise operator? D
A & B &=
C |= D <=
050. In Java variables, if first increment of the variable takes place and then the assignment occurs. A
This operation is also called
A pre-increment B post-increment
C incrementation D pre incrementation
051. Which component is responsible to run Java program? D
A JVM B JDK
C JIT D JRE
052. What is true about a break? B
A Break halts the execution of the loop for B Break halts the execution and forces the
certain time frame control out of the loop
C Break stops the execution of entire D Break forces the control out of the loop
program and starts the execution of next iteration
053. Decrement operator, −−, decreases the value of variable by what number? A
A 1 B 2
C 3 D 4
054. When the operators are having the same priority, they are evaluated from ............in the order D
they appear in the expression.
A right to left B any of the order
C depends on the compiler D left to right
055. Which operator is considered to be with highest precedence? C
file:///C:/PHD/JNTUK ONLINE/ONLINE EXAMS/jntuonlinecrack/banksdecrypted/R2022054/R2022054.html 4/14
4/28/22, 11:51 AM R2022054

A = B ?:
C () , [] D %
056. Which concept of Java is achieved by combining methods and attribute into a class? C
A Inheritance B Polymorphism
C Encapsulation D Abstraction
057. Which variables are created when an object is created with the use of the keyword 'new ' and B
destroyed when the object is destroyed?
A Local variables B Instance variables
C Class Variables D Static variables
058. What is stored in the object obj in following lines of Java code? box obj; D
A Memory address of allocated memory of B Any arbitrary pointer
object
C Garbage D NULL
059. Which of the following are legal lines of Java code? 1. int w = (int)888.8; 2. byte x = D
(byte)100L; 3. long y = (byte)100; 4. byte z = (byte)100L;
A 1 and 2 B 2 and 3
C 3 and 4 D All statements are correct
060. Which statement transfer execution to different parts of your code based on the value of an B
expression?
A If B Switch
C Nested-if D if-else-if
061. How many times does the following code segment execute int x=1, y=10, z=1; do{y; x++; y-=2; A
y=z; z++} while (y>1 && z<10);
A 1 B 10
C 5 D infinite
062. Which one is a valid declaration of a boolean? C
A boolean b1 = 1; B boolean b2 = false;
C boolean b3 = false; D boolean b4 = true;
063. An expression involving byte, int, and literal numbers is promoted to which of these? (M) A
A int B long
C byte D float
064. What is the return type of a method that does not return any value? D
A int B float
C double D void
065. Which of these is not a correct statement? D
A A recursive method must have a base case B Recursion always uses stack
C Recursive methods are faster that D Recursion is managed by Java Runtime
programmers written loop to call the environment
function repeatedly using a stack
066. Which of the following is a method having same name as that of its class? A
A constructor B finalize
C delete D class
067. All classes in Java are inherited from which class? D
A java.lang.class B java.class.inherited
C java.class.object D java.lang.Object
068. Which class cannot be sub classed? A
A final class B object class
C abstract class D child class
069. What is the process of defining a method in terms of itself, that calls itself? C
file:///C:/PHD/JNTUK ONLINE/ONLINE EXAMS/jntuonlinecrack/banksdecrypted/R2022054/R2022054.html 5/14
4/28/22, 11:51 AM R2022054

A Polymorphism B Abstraction
C Recursion D Encapsulation
070. Which of this keyword can be used in a subclass to call the constructor of superclass? A
A super B this
C extent D extends
071. When does method overloading is determined? B
A At run time B At compile time
C At coding time D At execution time
072. Which of these statement is incorrect? C
A Applets do not require a main() method at B There can be only one main() method in a
all program
C Every class must contain a main() method D main() method must be made public
073. If super class and subclass have same variable name, which keyword should be used to use super A
class?
A super B this
C upper D classname
074. Which of these is correct way of calling a constructor having no parameters, of superclass A by D
subclass B?
A super(void); B superclass.();
C super.A(); D super();
075. What is false about constructor? B
A Constructors cannot be synchronized in B Constructor can have a return type
Java
C Java does not provide default copy D this and super can be used in a constructor
constructor
076. Which of the following statements are incorrect? C
A default constructor is called at the time of B constructor can be parameterized
object declaration
C finalize() method is called when a object D finalize() method must be declared
goes out of scope and is no longer needed protected
077. Which of the following is used for implementing inheritance through class? C
A inherited B using
C extends D implements
078. What would be the behavior, if this() and super() used in a method? D
A Runtime error B Throws exception
C Runs successfully D compile time error
079. Which of this statement is incorrect? C
A If a function is defined public it can be B main() method must be made public
accessed by object of other class by
inheritance
C All object of a class are allotted memory D All object of a class are allotted memory
for the methods defined in the class for the all the variables defined in the
class
080. Which method can be defined only once in a program? A
A main method B finalize method
C static method D private method
081. Which keyword is used by the method to refer to the object that invoked it? B
A import B this
C catch D abstract
file:///C:/PHD/JNTUK ONLINE/ONLINE EXAMS/jntuonlinecrack/banksdecrypted/R2022054/R2022054.html 6/14
4/28/22, 11:51 AM R2022054

082. Which of these is correct about passing an argument by call-by-value process? A


A Copy of argument is made into the formal B Reference to original argument is passed
parameter of the subroutine to formal parameter of the subroutine
C Copy of argument is made into the formal D Reference to original argument is passed
parameter of the subroutine and changes to formal parameter of the subroutine and
made on parameters of subroutine have changes made on parameters of
effect on original argument subroutine have effect on original
argument
083. If a variable is declared final, it must include . value. C
A integer B no
C initial D float
084. A class that cannot be sub classes is called a -------- D
A parent class B child class
C revised class D final class
085. Which method compares the given object to this object? A
A public boolean equals(Object obj) B public final void notifyAll()
C public final void notify() D public final ClassgetClass()
086. All Java classes are derived from C
A java.lang.Class B java.util.Name
C java.lang.Object D java.awt.Window
087. Every method of a .. is implicitly final. B
A dynamic class B final class
C abstract class D static class
088. What would be behaviour if the constructor has a return type? A
A Compilation error B Runtime error
C Compilation and runs successfully D Only String return type is allowed
089. Base class is also known as---------- A
A super class B child class
C sub class D derived class
090. Inner classes are D
A anonymous classes B subclasses
C derived classes D nested classes
091. In which area of memory, the system stores parameters and local variables whenever a method is A
invoked?
A stack B heap
C storage area D array
092. .................Keyword is always a reference to the object. B
A new B this
C invoke D class
093. Which of the modifier cant be used for constructors? C
A public B private
C static D protected
094. Which among the following best describes polymorphism? C
A It is the ability for a message/data to be B It is the ability for many messages/data to
processed in only 1 form be processed in one way
C It is the ability for a message/data to be D It is the ability for undefined
processed in more than one form message/data to be processed in at least
one way
095. Which of these keywords is used to prevent content of a variable from being modified? A
file:///C:/PHD/JNTUK ONLINE/ONLINE EXAMS/jntuonlinecrack/banksdecrypted/R2022054/R2022054.html 7/14
4/28/22, 11:51 AM R2022054

A final B last
C constant D static
096. Method signature consists of------------------- C
A Method Name, Return Type and Number B Access Modifier, Method Name and
of Arguments Types of Arguments
C Method Name, Number of Arguments, D Return Type, Access Modifier and Order
Types of Arguments and Order of of Arguments
Arguments
097. Which of these cannot be declared static? B
A class B object
C variable D method
098. Which polymorphism feature is related to parent and child class relationship in java? C
A Method overloading B Constructor overloading
C Method overriding D overloading
099. Which of the following statements are incorrect? D
A static methods can call other static B static methods must only access static
methods only data
C static methods can not refer to this or D when object of class is declared, each
super in any way object contains its own copy of static
variables
100. Which of this keyword can be used in a subclass to call the constructor of superclass? B
A super B this
C extent D extends
101. Which of the following statement is true? D
A All nested classes can declare static B Non-static member classes must have
member classes either default or public accessibility
C Methods in all nested classes can be D Static member classes can contain non-
declared static static methods
102. Which option is false about the final keyword? A
A Afinalclass cannot extend other classes. B Afinalmethod can be inherited.
C Afinalclass cannot be extended. D Afinalmethod cannot be overridden in its
subclasses
103. Which among the following is false, for member function of a class ? C
A All member functions must be defined B Member functions can be defined inside
or outside the class body
C Member functions need not be declared D Member functions can be made friend to
inside the class definition another class using friend keyword
104. Size of a class is ------------- A
A Classes doesnt have any size B Size of the largest size of variable
C Sum of the size of all the variables along D Sum of the size of all the variables
with inherited variables in the class declared inside the class
105. What is the scope of a class nested inside another class? C
A Global scope B Private scope
C Depends on access specifier and D Protected scope
inheritance used
106. The variables declared in a class for the use of all methods of the class are called----- C
A reference variables B objects
C instance variables D global variables
107. ------------ method cant be overridden B
A super B final
file:///C:/PHD/JNTUK ONLINE/ONLINE EXAMS/jntuonlinecrack/banksdecrypted/R2022054/R2022054.html 8/14
4/28/22, 11:51 AM R2022054

C static D private
108. Which of these is correct way of calling a constructor having no parameters, of superclass A by D
subclass B?
A super(void); B superclass.();
C super.A(); D super();
109. The subclass constructor uses the ________ keyword to invoke the constructor of the superclass. B
A Final B super
C static D public
110. Overloading of constructors in Java means adding more than ___ constructors with the different A
argument list.
A 1 B 2
C 3 D 8
111. A constructor can call another overloaded constructor using the ___ keyword in Java. D
A super B local
C con D this
112. In Java, add a ___ to a constructor to convert it into a method. C
A if statement B static
C return type D semicolon
113. If two methods have same name but different parameter list then it is called____ A
A Method overriding B Method overloading
C Operator overloading D Method renaming
114. In Java, local variables are stored in __ memory and instance variables are stored in ___ C
memory.
A Stack, Stack B Heap, Heap
C Stack, Heap D Heap, Stack
115. Which of the following is true about the anonymous inner class? D
A It has only methods B Objects can 't be created
C It has a fixed class name D It has no class name
116. ______________ constructor is created when object of particular class is created. B
A Parameterized B Default
C Copy D no
117. The is an object reference operator and returns true if the object on the left-hand side is an B
instance of the class given on the right-hand side.
A dot operator(.) B instance of
C bitwise D conditional
118. Which symbol is used to contain the values of automatically initialized arrays? B
A Brackets B Braces
C Parentheses D Comma
119. Which will legally declare, construct and initialize an array? A
A int myList [] = {4, 3, 7}; B int [] myList = {"1", "2", "3"};
C int [] myList = (5, 8, 2); D int myList [] [] = {4,9,7,0};
120. What is the type of variable b and d in the following Java snippet? int a[], b; int []c, d; C
A b and d are int B b and d are arrays of type int
C b is int variable; d is int array D d is int variable; b is int array
121. If an index of an element is N, what is its actual position in the array? B
A N-1 B N+1
C N D N+2
122. An array elements are always stored in ________ memory locations. A
file:///C:/PHD/JNTUK ONLINE/ONLINE EXAMS/jntuonlinecrack/banksdecrypted/R2022054/R2022054.html 9/14
4/28/22, 11:51 AM R2022054

A Sequential B Random
C Sequential and Random D Binary search
123. Which of these operators is used to allocate memory to array variable in Java? D
A alloc B malloc
C new malloc D new
124. We cannot create a subclass of _________ class. B
A Abstract B final
C static D public
125. Given a method in a protected class, what access modifier do you use to restrict access to that C
method to only the other members of the same class?
A final B static
C private D protected
126. In Java, main() method returns a value of type------- A
A void B int
C real D string
127. What is the default value of a char data type elements of an array in Java? C
A 'A ' B '\0 '
C '\0 ' or null D null
128. How to copy contents of array? A
A System.arrayCopy() B Array.copy()
C Arrays.copy() D Collection.copy()
129. What will be the output of the following Java code? int arr[] = new int [5]; System.out.print(arr); D
A 0 B value stored in arr[0].
C 00000 D Garbage value
130. Multidimensional arrays are actually C
A Arrays of element B Arrays of variable
C Arrays of arrays D Arrays of variable
131. What is the default value of float or double data type elements of an array in Java? B
A 0 B 0.0
C 1 D 1.0
132. Which of these is an incorrect array declaration? D
A int arr[] = new int[5] ; B int [] arr = new int[5] ;
C int arr[]; D arr = new int[5];
133. Which of these is an incorrect array declaration? D
A int arr[] = new int[5] B int [] arr = new int[5]
C int arr[] = new int[5] D int arr[] = int [5] new
134. What is the default value of byte, short, int or long data type elements of an array in Java? C
A -1 B 1
C 0 D Garbage value
135. Where is an array stored in memory? A
A heap space B stack space
C heap space and stack space D first generation memory
136. A one dimensional array of one-dimensional array is called ------------- A
A two-dimensional array B three dimensional array
C multi array D multi-dimensional array
137. What is a dynamic array? D
A An array which is reallocated everytime B The memory to the array is allocated at
whenever new elements have to be added runtime
file:///C:/PHD/JNTUK ONLINE/ONLINE EXAMS/jntuonlinecrack/banksdecrypted/R2022054/R2022054.html 10/14
4/28/22, 11:51 AM R2022054

C An array which is created at runtime D A variable size data structure


138. When does the ArrayIndexOutOfBoundsException occur? B
A Compile-time B Run-time
C Not an error D Not an exception at all
139. What is array of objects? C
A An array of instances of class represented B An array of instances which have more
by more than one name than 2 instances
C An array of instances of class represented D An array of instances which have
by single name different types
140. Which of the following is the advantage of the array data structure? C
A Elements of mixed data types can be B Index of the first element starts from 1.
stored.
C Easier to access the elements in an array D Elements of an array cannot be sorted
141. Assuming int is of 4 bytes, what is the size of int arr[15];? D
A 15 B 19
C 11 D 60
142. Which of the following declarations will cause a compile time error? D
A int[] scores = null; B int[] scoreArray = {50,90,85};
C String[] nameArray = new String[10]; D String[] nameArray = {5, 3, 2};
143. Row number and Column number in a Multidimensional array start with ___. B
A -1 B 0
C 1 D 2
144. The smallest element of an array 's index is called its A
A lower bound. B upper bound.
C range. D extraction
145. What is not type of inheritance? B
A Single inheritance B Double inheritance
C Hierarchical inheritance D Multiple inheritance
146. Using which of the following, multiple inheritance in Java can be implemented? A
A Interfaces B Multithreading
C Protected methods D Private methods
147. In order to restrict a variable of a class from inheriting to subclass, how variable should be D
declared?
A Protected B Public
C Static D Private
148. If super class and subclass have same variable name, which keyword should be used to use super C
class?
A this B upper
C super D classname
149. The objects in an object array _______________________ B
A Can be created without use of constructor B Can be created without calling default
constructor
C Cant be created with use of constructor D Cant be created without calling default
constructor
150. The Object array is created in _____________________ A
A Heap memory B Stack memory
C HDD D ROM
151. Which among the following is a mandatory condition for array of objects? A

file:///C:/PHD/JNTUK ONLINE/ONLINE EXAMS/jntuonlinecrack/banksdecrypted/R2022054/R2022054.html 11/14


4/28/22, 11:51 AM R2022054

A All the objects should be of same class B All the objects should have different data
C All the objects should be of same program D All the objects should be of different class
classes
152. If array of objects is declared as given below, which is the limitation on objects? Class_name D
arrayName[size];
A The objects will have same data B The objects can never be initialized
C The objects will have same values D The objects will not be initialized
individually
153. Which is the condition that must be followed if the array of objects is declared without A
initialization, only with size of array?
A The class must have a default or zero B The class should not have any member
argument constructor function
C The class must have no constructors D The class should have separate
constructor for each object
154. Base class is also known as---------- A
A super class B child class
C sub class D derived class
155. In inheritance, the old class is known as-------- B
A start class B base class
C derived class D sub class
156. When more than one child classes have the same parent then it is called as-------- D
A single inheritance B multi level inheritance
C class inheritance D hierarchical inheritance
157. Which of the following is used for implementing inheritance through class? C
A inherited B using
C extends D implements
158. Can an object be a subclass of another object? C
A Yes---as long as single inheritance is B Only when one has been defined in terms
followed of the other
C No---inheritance is only between classes. D Yes---when one object is used in the
constructor of another.
159. Does a subclass inherit both member variables and methods? D
A No--only member variables are inherited. B No--only methods are inherited.
C Yes--but only one or the other are D Yes--both are inherited.
inherited.
160. All classes in Java are inherited from which class? D
A javlang.class B javclass.inherited
C javclass.object D javlang.Object
161. A class member declared protected becomes member of subclass of which type? C
A public member B private member
C protected member D static member
162. What type of inheritance does Java have? A
A single inheritance B double inheritance
C multiple inheritance D class inheritance
163. Which among the following is true? A
A Java doesnt support multiple inheritance B Java supports all types of inheritance
C Java supports multiple inheritance D Java doesnt support inheritance
164. Which of this keyword must be used to inherit a class? D
A super B this
file:///C:/PHD/JNTUK ONLINE/ONLINE EXAMS/jntuonlinecrack/banksdecrypted/R2022054/R2022054.html 12/14
4/28/22, 11:51 AM R2022054

C extent D extends
165. How many types of inheritance can be used at a time in a single program? A
A Any type, any number of times B Any 4 types
C Any three types D Any two types
166. Which type of inheritance is illustrated by the following code? class student{ public: int marks; C
}; class topper: public student { public: char grade; }; class average{ public: int makrs_needed;
}; class section: public average{ public: char name[10]; }; class overall: public average{ public:
int students; };
A Single level B Multilevel and single level
C Hierarchical D Hierarchical and single level
167. A class member declared protected becomes a member of subclass of which type? B
A public member B private member
C protected member D static member
168. Which of these is correct way of inheriting class A by class B? C
A class B + class A {} B class B inherits class A {}
C class B extends A {} D class B extends class A {}
169. Which of the following is NOT an advantage to using inheritance? D
A Code that is shared between classes needs B Similar classes can be made to behave
to be written only once consistently.
C Enhancements to a base class will D One big superclass can be used instead of
automatically be applied to derived many little classes.
classes.
170. When a class extends a class, which extends another class then this is called --------- inheritance C
A single level B two level
C multi level D many level
171. .. helps to extend the functionality of an existing by adding more methods to the subclass. A
A Inheritance B Mutual Exclusion
C Package D Interface
172. When more than one child class have the same parent class then it is called ----- B
A single inheritance B hierarchical inheritance
C multiple inheritance D multilevel inheritance
173. Which feature of OOP encourages code reusability? C
A polymorphism B abstraction
C inheritance D encapsulation
174. A class that cannot be sub classed is called a ------------ D
A child class B parent class
C base class D final class
175. When you pass an array to a method, the method receives ------------ A
A The reference of the array. B A copy of the array.
C A copy of the first element. D The length of the array
176. In object oriented programming new classes can be defined by extending existing classes. This is D
an example of:
A Encapsulation B Interface
C Composition D Inheritance
177. Object oriented inheritance models the--------------- A
A "is a kind of" relationship B "has a" relationship
C "want to be" relationship D inheritance does not describe any kind of
relationship between classes
178. super keyword in Java is used for? B
file:///C:/PHD/JNTUK ONLINE/ONLINE EXAMS/jntuonlinecrack/banksdecrypted/R2022054/R2022054.html 13/14
4/28/22, 11:51 AM R2022054

A to refer to immediate child class of a B to refer to immediate parent class of a


class. class.
C to refer to current class object. D to refer to static member of parent class.
179. How many classes can be inherited by a single class in java? A
A Only 1 B Only 27
C Only 255 D Only 1024
180. If subclass (child class) has the same method as declared in the parent class, it is known as ------- B
----
A Method overriding B Method overloading
C Constructor overloading D method defining

file:///C:/PHD/JNTUK ONLINE/ONLINE EXAMS/jntuonlinecrack/banksdecrypted/R2022054/R2022054.html 14/14

You might also like