Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                

Opps

Download as pdf or txt
Download as pdf or txt
You are on page 1of 7

Paper Code :

MC-6626( 111058

M. C, A. (Second Semester)
EXAMINATION, 2022
OBJECT ORIENTEDPROGRAMMING

Roll No. (in figures) Maximum Marks:70


ocH F: 70
Roll No. (in words) Time : 1 Hours

Centre of Examination
No. of Questions : 50
Name of Candidate RISHABH SHRIVASTAr
(S
Signature of Candidate : Qskid
Signature of Invigilator

DONOT OPEN TEST B0OKLET UNLESS YOU ARE ASKED TO DOSO

FIRST READ ALL THE INSTRUCTIONS


IMPORTANT INSTRUCTION
1. The booklet contains 50 questions. Examinee 1. wA-yo
is required to answer any 35 questions in the
50 g ae f
OMR Answer-Sheet provided and not in the
question booklet. If more than 35 questions are
attempted by student, then the first attempted
35 questions will be considered fof evaluation.
Allquestions carry equal marks.
(Rest of the instructions are given at the back cove)
1
Which of the following What will be the output of the following
the' portabilityand options leads to 5.

()
securityof Java ? program ?
Bytecode is executed by JVM. abstract class MyFirstClass
(B) The applet
makes the Java code {
secure and portable. abstract num (int a, int b) {}
(C) Use of exception
handling.
(D) Dynamic binding between
objects. (A) No error
2.
Which of the following is not a Java (B) Method is not defined properly.
feature ? (C) Constructor is not defined properly.
(D) Extra parentheses
(A) Dynamic
(B) Architecture Neutral 6. Which of the following is not an 0OPS
Concept ?
(g Use of pointers
(A) Encapsulation
(D) Object-oriented
(B) Polymorphism
3. What do you mean by chained exceptions (eY Exception
in Java ? (D) Abstraction
(A) Exceptions occurred by the
7. When does static binding occur ?
VirtualMachineError.
A) Static binding Occurs during
An exception caused by other compile time.
exceptions.
(B) Static -binding occurs during load
(C) Exceptions occur in chains with time.
discarding the debugging (C) Static binding OCcurs during
information. runtime.
(D) None of the above (D) None of the above

4. Which keyword is used for accessing the 8. What happens when thread's sleep( )
features of package ? method is called ?
(A) package (A) Thread returns to the ready state.
(B) import (B) Thread returns to the waiting state.
(C) extends (C) Thread starts running.
O) export (D) None of the above

MC-6626(N) (2)
9. What will happen if static modifier is
removed from the signature of the main
14.
Which/of. the following is a method
method ? hayíng same nanme as that of its class ?
(A) Compilation Error. (A) finalize
B RunTime Errror (B) delete
NoSuchMethodError.
(C) Program will compile and run (C) class
without any output. D) constructor
(D) Program will compile and run to
show the required output. 15. Which function is used to perform some
10. Which exXception is thrown when java is action when the object is to be destroyed ?
out of memory ?
(A) MemoryError (AY finalize()
B} OutOfMemoryError (B) delete( )
(C) MemoryOutOfBoundsException (C) main( )
(D) MemoryFullException
(D) None of the mentioned
11. Which of these keywords are used for the
block of code to be 16. Using which of the
examined for following, multiple
cxceptions?
(A) check inheritance in Java can be implemented ?
(B) throw A) Interfaces
(C) catch (B) Multithreading
Y try (C) Protected methods
12. What is the return type of Constructors ? (D) Private methods
(A) int
(B) float 17. In order to restrict a variable of a class
(CY void
(D) None of the mentioned from inheriting to subclass, how variable
should be declared ?
13. Which keyword is used by the
method to
refer to the object that invoked it ? (A) Protected
(A) import (PY Private
(B) catch
(C) abstract (C) Public
D) this (D) Static

MC-6626(N) (3)
18. If super class and subclass have same 22. Which of these can be used to fully
variable name, which keyword should be abstract a class from its implementation ?
used to use super class ?
(A) Objects
A) super (B) Packages
(B) this (9 Interfaces
(C) upper (D) None of the mentioned
(D) classname
23. Which of the following is the correct way
19. Which of the following is used for of implementing an interface salary by
implementing inheritance through an class manager ?
interface?
(A) class manager extends salary {}
(A) inherited B) class manager implements salary {}
(B) using (C) class manager importssalary {}
(C) extends (D) None of the mentioned
DY implements
24. Which of these methods of Thread class is
20. Which of these keywords is used to used to find out the priority given to a
generate an exception explicitly ? thread ?
(A) try (A) get()
(B) finally (B) ThreadPriority( )
throw egetPriority( )
(D) catch (D) getThreadPriority()
21. Which of these keywords is used to by the 25. Which of these methods of Threadclass is
calling function to guard against the used to Suspend a thread for a period of
exception that is thrown by called function ? time ?
(A) try ( sleep()
throw (B) terminate( )
(C) throws (C) suspend()
(D) catch
(D) stop()
MC-6626(N) (4)
26. Which function of pre defined class 29. Which concept of Java is achieved by
Thread is used to check weather current
combining methos and attribute into a
thread being checked is still running ? class ?
(A) isAlive( ) ) Encapsslation
(B) Join() (B) Inheritance
(C) isRunning( ) (C) Polymorphism
P) Alive() (D) Abstraction
27. What will be the output of the following 30. Method overriding is combination of
Java code ? inheritance and polymorphism :
(1) class multithreaded_programing (A) True
(2) { (B) False
(3) public static void main (string args (C) Partially true
(D) None of the above
(4) { 31. Which of these is a process of
(5) converting
Thread t = Thread . currentThread ( a simple data type into a class?
A type wrapping
(6) t. setName ("New Thread"); (B) type conversion
(7) System . out. println (t); (C) type casting
(8) } (D) None of the mentined
(9) 32. Which component is' used to compile,
(A) Thread[5,main]
debug and execute java program ?
(B). Thread[New Thread,5] (A) JVM
(C) Thread[main,5,main]
B) JDK
(D) Thread[New Thread,5,main] (C) JIT
28. What is the process of defining more than (D) JRE
one method in a class differentiated by 33. Which component is responsible for
method signature ? converting bytecode into machine specific
(A) Function overriding code ?
B Function overloading A) JVM
(C) Function doubling (B) JDK
(D) None of the mentioned (C) JIT
(D) JRE
MC-6626(N)
(5)
34, Which of the below is invalid identifier 39. Which of these packages contains all the
with the main method ? classes and methods required for even

(A) public handling in Java ?


(B) static
(A) java.applet
private
(D) final
B java.awt
(C) java.event
35. Which of these functions is called to
display the output of an applet ? (D) java.awt.event
(A) display( ) 40. Which of these class is superclass of
BYpaint() String and StringBuffer class ?
(C) displayApplet( )
(D) PrintApplet( ) (A) java.util

36. Which of these methods can be used to B java.lang


output a string in an applet ? (C) ArrayList
(A) display() (D) None of the mentioned
(B) print( )
41. Which of these methods of class String is
e) drawString()
(D) transient( ) used to obtain a length of String object ?

37. Which of these methods is a part of (A) get()


Abstract Window Toolkit (AWT) ? (B) sizeof( )
(A) display( ) (C) lengthof()
paint() D) length( )
(C) drawString( )
(D) transient( ) 42. Which of these methods of class String is
used to extract a single character from a
38. Which of the following is a mechanism
for naming and visibility controlof a class String object ?
and its content ? (A) CHARRAT()
(A) Object (B) chatat( )
AB) Packages charAt( )
(
(C) Interfaces
(D) ChatAt()
(D) None of the mentioned

MC-6626(N) (6)
43. Which of these constructors is used to 46. How can a protected modifier be accessed ?
create an empty String object ? (A) accessible only within the class
String( ) (B accessible only within package
(B) String(void) (C) aceessible within package and
outside the package but through
(C) String(0) inheritance only
(D) None of the mentioncd (D) accessible by all
47. Allthe variables of interface should be :
44. Which of these methods wakes up all the
(A) default and final
threads ?
(B) default and static
(A) wakeAll() eY public, static and final
(B) notify( ) (D) protect, static and final
48. How many copies of static and class
(C) start( )
variables are created when 10 objects are
Pr notifyAl() created of a class ?
45. What is synchronization in reference to a (A 1, 10
thread ? (B) 10, 10
(C) 10, 1
(A} It's a process of handling situations (D) 1, 1
when two or more threads need 49. Which is the modifier when there is none
access to a shared resource. mentioned explicitly ?
(B) It's a process by which many (A) protected
threads are able to access same (B) private
(C) public
shared resource simultaneously.
D) default
(C) I's a process by which a method is 50. Which of these packages contains abstract
able to access many different keyword ?
threads simultaneously. AA) java.lang
(D) It's a method that allow too many (B) java.util
threads to access any information (C) java.io
(D) java.system
the require.

C-6626(N) (7)

You might also like