AllPossibleQuestionBank (Desc&Obj) ..R22 OOPSJAVA 2324SEM1..14112023
AllPossibleQuestionBank (Desc&Obj) ..R22 OOPSJAVA 2324SEM1..14112023
QUESTION BANK
Updated: 14.11.2023
1
OBJECT ORIENTED PROGRAMMING USING JAVA
AY 23-24 SEM-1 (R22)
UNIT-I (All Possible Questions)
S.
Questions Marks CO PO BTL
No
a). Why is Java known as platform independent? 1M 1 2 1
b). Differentiate this and this (). 1M 1 4 2
1 Define an Array. Write 2-D Array declaration and initialization
c). 4M 1 3 3
syntax.
d). Construct a Java Program for matrix multiplication 6M 1 5 4
a). Describe type casting? Explain with an example. 1M 1 1 1
b). Demonstrate different control structures with syntax and example. 1M 1 2 2
2
c). What are characteristics of an object in java. Explain with Example 4M 1 3 3
d). List and explain the Java buzzwords in detail 6M 1 4 4
a). What is difference between .class file and .java file 1M 1 3 1
b). Explain various data types in Java along with their size and range. 1M 1 2 2
c). Illustrate constructor overloading concept with an example 4M 1 5 3
3
Develop a java program to calculate the area and circumference of a
d). circle where the input from the keyboard. (area formula=pi*r*r, 6M 1 3 4
Circumference formula=2*pi*r, use java.lang.PI for pi value)
a). Define Abstraction and Encapsulation. 1M 1 5 1
b). Define recursion and explain. 1M 1 4 2
4
c). What are different Access Specifiers in Java. Explain in detail 4M 1 2 3
d). Explain about JVM's Garbage Collection in detail 6M 1 6 4
a). Define variable with example 1M 1 3 1
b). List and explain various types of variables? 1M 1 2 2
5 Develop a java program to check given number is
c). 4M 1 5 3
Armstrong number or not.
d). Explain about OOPS Paradigm. 6M 1 3 4
What is the size of char data type? Why does it differ from C
a). 1M 1 2 1
language?
6 b). Differentiate while loop and do-while loop. 1M 1 3 2
c). Illustrate about for and foreach loop with java codes. 4M 1 5 3
d). List out various types of operators in java with examples. 6M 1 4 4
Does Java support multi way selection statement? Justify your
a). 1M 1 2 1
answer.
b). Describe how to instantiate a class in Java program? 1M 1 6 2
7
Demonstrate objects as parameter to a constructor with example
c). 4M 1 3 3
program.
d). Explain in detail about java literals 6M 1 2 4
a). List the properties of a constructor. 1M 1 5 1
b). Explain Polymorphism and its types. 1M 1 3 2
Develop a program to create an object reverse number then use that
c). 4M 1 2 3
object for finding given number is palindrome or not.
8 Develop a java program to print the following pattern using for loop.
*
d). ** 6M 1 2 4
***
****
2
*****
a). Explain why java is more secured than other languages? 1M 1 2 1
b). What is byte code? When it will be generated 1M 1 3 2
9 what is the difference between instance variable, static variable, final
c). 4M 1 3
variable
d). Explain about Nested and Inner Classes 6M 1 3 4
a). What is String Literal Pool in Java 1M 1 2 1
b). What is JIT Compiler in java 1M 1 2 2
10 Develop a java program to check weather a given number is prime or
c). 4M 1 4 3
not.
d). Define a String. Explain String handling functions. 6M 1 3 4
4
Construct a java program to demonstrate how to synchronize a share
d). 6M 3 3 4
resource in java.
a). Interpret synchronization and why is it important? 1M 3 2 1
b). Characterize to set priorities for threads? 1M 3 3 2
7 Summarize 're-throwing' exception? Discuss a suitable scenario for
c). 4M 4 3
this.
d). Construct a java program to explain thread priorities usage. 6M 3 3 4
a). Summarize methods of Inter thread communication. 1M 3 3 1
b). Differentiate Thread based and Process Based Multi-Threading 1M 3 4 2
8 Summarize the differences between thread-based multitasking and process-
c). 4M 3
based multitasking.
3 5
Compose a java program to create three threads in your program and
d). 6M 4
context switch among the threads using sleep functions.
a). Differentiate between thread and process 1M 3 2 1
b). Distinguish the thread based pre-emptive multitasking? 1M 3 4 2
Design a program that creates a thread that forces pre-emptive scheduling
9 c). 4M 3 3
for lower priority threads.
Discuss and differentiate the ways of creating threads in java using
d). 6M 3 5 4
the thread class and the Runnable interface.
a). Factor how to achieve synchronization among threads? 1M 3 2 1
b). Characterise the start and stop a thread? 1M 3 1 2
Justify the producer - consumer problem using inter - thread
10 c). 4M 3 3
communication
Develop a program that creates two threads. Fist thread prints the
d). numbers from 1 to 100 and the other thread prints the numbers from 6M 3 4 4
100 to 1.
5
a). Generalize is Java Foundation Classes 1M 4 3 1
b). Describe Keyboard Events from Component class. 1M 4 3 2
5 Factor the role of Event Handling in AWT. Provide an example of
c). 4M 4 4 3
handling a mouse click event.
d). Describe in detail about the various event listener interfaces. 6M 4 3 4
a). Judge are the limitations of AWT? 1M 4 3 1
b). Tabulate the Menu Items. 1M 4 2 2
6 c). Identify is the difference between Boarder layout and Grid layout? 4M 4 1 3
7
VIGNAN INSTITUTE OF TECHNOLOGY & SCIENCE::DESHMUKHI
UNITWIZE OBJECTIVE QUESTIONS
COMMON TO CSE, CSE(DS), AI&DS
SUBJECT: OBJECT ORIENTED PROGRAMMING USING JAVA
8
Updated 14.11.2023
OBJECT ORIENTED PROGRAMMING USING JAVA
23-24 SEM1 (R22)
OBJECTIVE QUESTIONS
UNIT-I
6. What is the process of defining more than one method in a class differentiated by [ ]
method signature?
A. Method overriding B. Method overloading
C. Method bounding D. Method chaining
8. Which keyword is used by the method to refer to the object that invoked it? [ ]
A. import B. catch
C. abstract D. this
10. Which of these keywords is used to access a member of class before the object [ ]
of that class is created?
A. public B. private
C. static D. protected
16. _____________ is a concept in OOP which hides unimportant implementation details from other
objects.
19. String literal is a sequence of characters enclosed within _____________ quotation marks.
10
OBJECTIVE QUESTIONS FOR UNIT-II
MULTIPLE CHOICE QUESTIONS
CHOOSE THE CORRECT ANSWER:
1. Which of these is a mechanism for naming and visibility control of a class and its [ ]
content?
A. Object B. Packages
C. Interfaces D. JRE
2. Which of these access specifiers can be used for a class member so that they can [ ]
be accessed by a different class in the same package?
A. public B. protected
C. No Modifier D. No Modifier or protected or public
5. Which of these can be used to fully abstract a class from its implementation? [ ]
A. Objects B. Packages
C. Interfaces D. encapsulation
6. Which of the following is the correct way of implementing an interface salary by class [ ]
manager?
A. class manager extends salary{} B. class manager implements salary{}
C. class manager imports salary{} D. class manager: public salary
8. Which of these packages contain classes and interfaces used for input & output [ ]
operations of a program in java?
A. java.util B. java.lang
C. java.io D. java.net
10. Which of these classes has methods to read primitive datatype types from a file? [ ]
11
A. InputStream B. FileInputStream
C. DataInputStream D. FileReader
12
OBJECTIVE QUESTIONS FOR UNIT-III
CHOOSE THE CORRECT ANSWER:
1. When does Exceptions arises in code sequence [ ]
A. try B. Finally
C. thrown D. catch
4. Which keyword when applied on a method indicates that only one thread should [ ]
execute the method at a time.
A. volatile B. synchronized
C. Native D. static
9. What will happen if two thread of the same priority are called to be processed [ ]
simultaneously?
13
FILL IN THE BLANKS
11. __________________ exceptions are Unchecked exception
13. __________________ is the super class for all exception classes in java
14. __________________ keyword is used to by the calling function to guard against the exception
that is thrown by called function.
17. ________ Exception will be thrown if you try to invoke a method on a null reference.
18. _________Exception will be thrown if you try to open a file which do not exist.
19. _________method is used by a thread to voluntarily give control to another thread with same
priority.
14
OBJECTIVE QUESTIONS FOR UNIT-IV
CHOOSE THE CORRECT ANSWER:
1. components are referred to as heavy weight components than swings [ ]
A. Graphics B. Event
C. AWT D. Layout
2. __________ Interface defines the action performed method that is invoked when an [ ]
action event occurs.
A. ActionListener B. ItemListener
C. AdjustmentListener D. key Listener
12. ________________ method used to place some text in the text field?
13. ___________________________ is the listener used to handle the events of a text field?
14. __________________ method used to change the foreground (text) color of components like
15
text field?
17. ________________object can be constructed to show any number of choices in the visible
window?
19. ______________ is a component in AWT that can contain another components like buttons,
textfields, labels etc.?
20. _______________ are passive controls that do not support any interaction with the user?
16
OBJECTIVE QUESTIONS FOR UNIT-V
CHOOSE THE CORRECT ANSWER:
1. Which of these functions is called to display the output of an applet? [ ]
A. display() B. paint()
C. displayapplet() D. printapplet()
4. Applets cannot make network connection exception to the server host from which it [ ]
originated.
A. True B. False
C. True or False D. Cannot Say
5. What invokes immediately after the start() method and also any time the applet needs to [ ]
repaint itself in the browser?
A. stop() B. init()
C. paint() D. destroy()
8. ____________method is called only once during the run time of your applet [ ]
A. start() B. init(
C. stop() D. paint()
14. ______________is the top level container that is commonly used for swing applets.
17
15. _______________class helps us to avoid the implementation of abstract methods under
WindowListener while creating a Window
18