PDF Google Drive Downloader v1.1


Báo lỗi sự cố

Nội dung text OOP in JAVA MCQs.pdf


Prepared by Uni Bytes / www.unibytes.xyz Don't use our content without permission. Tribhuvan University Faculty of Humanities and Social Science Semester: III Subject: OOP in JAVA 2021 Batch Multiple Choice Question i. Which of the following is not a primitive data type defined in Java? a) Byte b) Long c) Boolean d) String ii. Which of the following is not a valid declaration of a for loop? a) for(int a = 7; a <= 77; a += 7) b) for(int a = 99; a >= 0; a / 9) c) for(int a = 2; a <= 20; a = 2 * a) d) for(int a = 20; a >= 2; --a) iii. What is the process by which one object acquires all the properties and behaviors of another object? a) Inheritance b) Polymorphism c) Abstraction d) Encapsulation iv. Which of the following is an unchecked exception in Java? a) IOException b) SQLException c) NullPointerException d) FileNotFoundException v. Which of the following keywords is used to derive a child interface from a parent interface? a) package b) import c) extends d) implements vi. What is the process when two or more threads need to access a shared resource, and they need a way to ensure that the resource is used by only one thread at a time? a) Deadlock b) Synchronization c) Interthread communication d) Starvation vii. Which of the following classes is used to read data from a file in a character stream? a) FileInputStream b) FileOutputStream c) FileReader d) FileWriter viii.Which of the following is not a method of Iterator? a) hasNext() b) next() c) remove() d) empty() ix. What is the name of the Swing control that normally displays one entry and acts as a dropdown list? a) JList b) JComboBox c) JRadioButton d) JCheckBox x. Which of the following JDBC components is used to handle communication with the database server? a) DriverManager b) Driver c) Connection d) SQLException Don’t Forget to Follow Uni Bytes
Prepared by Uni Bytes / www.unibytes.xyz Don't use our content without permission. Tribhuvan University Faculty of Humanities and Social Science Semester: III Subject: OOP in JAVA 2020 Batch Multiple Choice Questions i. Which of the following is not a feature of Java? a) Simple b) Secure c) Pointer d) Robust ii. Which function is used to get a single character from the Scanner? a) next() b) next().charAt(0) c) next().charAt(0) d) next.line() iii. Which of the following is not a jumping statement in Java? a) goto b) break c) return d) continue iv. What is the process by which we control which parts of a program can access members of a class? a) Polymorphism b) Abstraction c) Encapsulation d) Inheritance v. What is the return type of a constructor in Java? a) int b) String c) void d) none vi. Which keyword is used to refer to the base class constructor from a subclass constructor in Java? a) this b) final c) super d) static vii. Which of the following is not a keyword used in exception handling? a) thrown b) catch c) try d) finally viii.Which of the following is not a method of the Wrapper class? a) valueOf() b) indexOf() c) parseDouble() d) equals() ix. Which of the following is not an adapter class used in event handling? a) ActionAdapter b) KeyAdapter c) MouseAdapter d) WindowAdapter x. Which of the following methods is used to execute a SELECT query in JDBC API? a) executeQuery() b) executeUpdate() c) executeNonQuery() d) executeReader() Don’t Forget to Follow Uni Bytes
Prepared by Uni Bytes / www.unibytes.xyz Don't use our content without permission. Tribhuvan University Faculty of Humanities and Social Science Semester: III Subject: OOP in JAVA 2019 Batch Multiple Choice Questions i. Which one of the following is a ternary operator? a) >> b) >>> c) += d) ?: ii. Which keyword is used to make a variable constant in Java? a) super b) constant c) global d) final iii. Which of the following is not a keyword in Java? a) boolean b) default c) this d) implicit iv. Which of these operators can skip evaluating the right-hand operand? a) ^ b) | c) & d) && v. Which of these keywords is not a part of exception handling? a) try b) finally c) threw d) catch vi. The method that returns a string associated with a GUI Button is: a) getSource() method b) setSource() method c) getActionCommand() method d) setActionCommand() method vii. Which one of the following is the container that doesn’t contain a title bar and menu bar but can have other GUI components such as buttons and text fields? a) Window b) Frame c) Panel d) Menu viii.Which of the following classes is defined in the javax.swing package? a) Button b) JButton c) Applet d) Frame ix. Which method is automatically called after the browser calls the init method? a) start b) stop c) destroy d) paint x. In which of the following packages does the Integer class exist? a) java.util b) java.file c) java.io d) java.lang Don’t Forget to Follow Uni Bytes

Tài liệu liên quan

x
Báo cáo lỗi download
Nội dung báo cáo



Chất lượng file Download bị lỗi:
Họ tên:
Email:
Bình luận
Trong quá trình tải gặp lỗi, sự cố,.. hoặc có thắc mắc gì vui lòng để lại bình luận dưới đây. Xin cảm ơn.