0% found this document useful (0 votes)
11 views2 pages

OOPS Using Java Exam Questions 2021

Uploaded by

Kishan Gupta
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)
11 views2 pages

OOPS Using Java Exam Questions 2021

Uploaded by

Kishan Gupta
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

Roll No.

: ………………………………
B.E. 4TH Semester Examination- May,2021
OOPS USING JAVA
Branch:-CSE
(New Course)
Time: 3 Hours Max. Marks: 60
Note:- Attempt all questions from Section-‘A’ , two questions from Section-‘B’ and two
questions from Section-‘C’.
SECTION-A 1*10=10
1. What is the range of short data type in Java?
a) -128 to 127 b) -32768 to 32767 c) -2147483648 to 2147483647
d) None of the mentioned
2. Which of the following loops will execute the body of loop even when condition controlling the
loop is initially false?
a) do-while b) while c) for d) none of the mentioned
3. What is true about private constructor?
a) Private constructor ensures only one instance of a class exist at any point of time
b) Private constructor ensures multiple instances of a class exist at any point of time
c) Private constructor eases the instantiation of a class
d) Private constructor allows creating objects in other classes
4. What is the process of defining more than one method in a class differentiated by method
signature?
a) Function overriding b) Function overloading c) Function doubling d) None of the mentioned
5. Which of these is not a correct statement?
a) Every class containing abstract method must be declared abstract
b) Abstract class defines only the structure of the class not its implementation
c) Abstract class can be initiated by new operator
d) Abstract class can be inherited
6. Which of these access specifiers can be used for an interface?
a) Public b) Protected c) private d) All of the mentioned
7. Which are passive controls that do not support any interaction with the user?
a. Choice b. List c. Labels d. Checkbox
8. These two ways are used to create a Frame By creating the object of Frame class (association)
By extending Frame class (inheritance)
a. True b. False
9. Which of these keywords is used to by the calling function to guard against the exception that
is thrown by called function?
a) try b) throw c) throws d) catch
10. Which of these keywords is used to generate an exception explicitly?
a) try b) finally c) throw d) catch

SECTION-B 10*2=20
1. What is an Array? Write the different ways to initialize an array. Write a program in java to sort
a given integer array.
2. What is dynamic binding? Demonstrate the concept of dynamic binding with the help of suitable
java program.
3. Distinguish between checked and unchecked exceptions and then identify which of the following
exceptions are checked, and which are unchecked:
• FileNotFoundException; • NegativeArraySizeException; • NullPointerException
• NumberFormatException; • IOException; • Exception; • ArrayIndexOutOfBoundsException
4. What are constructors? Explain different types of constructor with example.
SECTION-C 15*2=30
1. What is an event? How events are handled? Write the procedure to handle a button click event
with proper programming syntax in Java.
2. Explain life cycle of a thread with the help of diagram. Write a code in java to demonstrate the
life cycle of a thread.
3. Explain working of Java Virtual Machine (JVM) and explain how java is architectural neutral.
4. What is container? What are the different types of components in AWT? Write a program in java
to create different components and add them into a container.

You might also like