Order PDF of any content from our website with a little minor Fee to donate for hard work. Online MCQs are fully free but PDF books are paid. For details: contact whatsapp +923028700085 Important notes based PDF Books are available in very little price, starting from 500/-PKR; Order Now: contact whatsapp +923028700085

VU Past Papers CS506 – Midterm Most important Solved

Q1: Which of the following feature provide facility for multiple inheritance?
(A) Adapter Classes
(B) Wrapper Classes
(C) Interface
(D) Collection
Answer: (C) Interface

Q2: The relationship between class and interface is called:
(A) ‘Is a’ relationship
(B) ‘Has a’ relationship
(C) ‘Responds to’ relationship
(D) None of the given options
Answer: (A) ‘Is a’ relationship

Q3: Which of the following function will be used to register event handler with events generator (button)?
(A) addAction()
(B) addListener()
(C) addActionListener()
(D) Register eventhandler()
Answer: (C) addActionListener()

Q4: The collection API are defined in which package?
(A) java.io
(B) java.util
(C) java.sql
(D) java.awt
Answer: (B) java.util

Q5: Which of the following is true about abstract class?
(A) An abstract class must have all methods declared as abstract methods.
(B) A class must have at least one abstract method to be an abstract class.
(C) A class without any abstract method can be declared as abstract class.
(D) An instance of abstract class can be created.
Answer: (C) A class without any abstract method can be declared as abstract class

Q6: Exceptions must be handled while handling files otherwise it may lead to:
(A) Logical error
(B) Syntax error
(C) No error
(D) Run time error
Answer: (D) Run time error

Q7: Which of the following stream is a filter stream?
(A) BufferedReader
(B) FileWriter
(C) FileReader
(D) All of given options
Answer: (A) BufferedReader

Q8: CREATE, ALTER, DROP are SQL statements of:
(A) DML
(B) DDL
(C) DCL
(D) None of above
Answer: (B) DDL

Q9: Which of the following statement object is used to execute stored procedures?
(A) Statement
(B) PreparedStatement
(C) CallableStatement
(D) None of given options
Answer: (C) CallableStatement

Q10: Based on functionality, the streams can be categorized as:
(A) Byte oriented streams and Node Streams
(B) Filter stream and Character oriented stream
(C) Node stream and Filter stream
(D) Byte oriented stream and Character oriented stream
Answer: (D) Byte oriented stream and Character oriented stream

Q11: Which of the following belongs to a category of checked exception?
(A) NullPointerException
(B) IOException
(C) ArrayIndexOutOfBoundsException
(D) NumberFormatException
Answer: (B) IOException

Q12: Which of the following is called “pure abstract class”?
(A) Concrete class
(B) Wrapper class
(C) Interface
(D) Abstract class with no abstract method
Answer: (C) Interface

Q13: An instance of abstract class cannot be created.
(A) True
(B) False
Answer: (A) True

Q14: Which of the following is used for inheritance in Java?
(A) implements
(B) extends
(C) : (colon)
(D) inherit
Answer: (B) extends

Q15: Which of the following package needs to import while interacting with relational database?
(A) java.io
(B) java.sql
(C) javax.swing
(D) java.awt
Answer: (B) java.sql

Q16: Window, frame and dialog use ______ as their default layout.
(A) Border layout
(B) Flow layout
(C) GridBag layout
(D) Grid layout
Answer: (A) Border layout

Q17: A collection can store:
(A) Homogenous objects
(B) Heterogeneous objects
(C) Objects as well as primitive values
(D) At most 100 objects
Answer: (B) Heterogeneous objects

Q18: Which of the following is a general purpose container?
(A) JFrame
(B) Dialog
(C) JPanel
(D) JApplet
Answer: (C) JPanel

Q19: Overloading is ______ whereas overriding is ______.
(A) Run time binding, compile time binding
(B) Late binding, compile time binding
(C) Compile time binding, run time binding
(D) Run time binding, late time binding
Answer: (C) Compile time binding, run time binding

Q20: The relationship between class and interface is called:
(A) ‘Is a’ relationship
(B) ‘Has a’ relationship
(C) ‘Responds to’ relationship
(D) None of the given options
Answer: (A) ‘Is a’ relationship

Contents Copyrights Reserved By T4Tutorials