Rumman Ansari
Home
Blog
Courses
Paid Courses
Authentication
D365 F&O MCQ Questions - X++ Programming Language MCQ
Digital Productivity
GH-300: GitHub Copilot
ICSE Computer Applications Class 10 – Previous Year Question Papers & Solutions
Java Fundamentals: Building Strong Foundations
Mastering JavaScript: From Fundamentals to Advanced Concepts
MB-500: Microsoft Dynamics 365: Finance and Operations Apps Developer
X++ Programming Fundamentals - D365 F&O Technical
X++ Programming Language
Free Courses
AB-730: Microsoft Certified: AI Business Professional
AJAX
AngularJS
Arithmetic Aptitude
Artificial intelligence
Automata Theory
AZ-400: Designing and Implementing Microsoft DevOps Solutions
Azure DevOps for Beginners
Bangla to English
Biography
Biology
Bootstrap 4
C Programming Language
C Programming Language Video Bangla
C# Programming Language
C++ language
Competitive Exam
Computer Awareness
Computer Fundamentals
Computer Network
Computer Science and Engineering
Continuous Deployment
Continuous Integration
CSS
Current Affairs
Data Structure
Database Management System
Digital Logic
Education
Electrical Engineering
English
English Grammar
General Aptitude
Geography
History
HTML 5
Important Days and Dates
Interview Questions
ISC - COMPUTER SCIENCE - XI
Islam
Java Programming Language
JavaScript
Leadership behavior and Culture
Logical Fallacy
Machine Learning
Mastering HTML: From Fundamentals to Advanced Concepts
Mathematics
Mathematics for Programming
Mathematics in Bangla - Class 5
MB-310: Microsoft Certified: Dynamics 365 Finance Functional Consultant Associate
MB-330: Microsoft Certified: Dynamics 365 Supply Chain Management Functional Consultant Associate
MB-700: Microsoft Dynamics 365: Finance and Operations Apps Solution Architect
MB-920: Microsoft Dynamics 365 Fundamentals (ERP)
Microservices Architecture
Microsoft Azure
Microsoft Excel - Bangla
Mindwork games
Miscellaneous Topics
Misconceptions about Islam
MySQL
Neural Networks and Deep Learning
NPM - Package Manager
Pakistan Geography
Photoshop
PHP
Programming Language
Prompt Engineering
Puzzles
Python
R Programming Language
ReactJS
Science
Social Science
SQL
SQLite
Tamil Nadu State board (Class 10)
Technical MCQs
Technical Short Answers
TypeScript - JavaScript's Superset
UGC NET, SET
User Experience
Verbal and Reasoning
Vue JS
অতীত ও ঐতিহ্য: অষ্টম শ্রেণীর: পশ্চিমবঙ্গ মধ্যশিক্ষা পর্ষদ
অর্থনীতি
আরবী ভাষা কোর্স - Diploma in Arabic language
ইতিহাস
ইতিহাস ও পরিবেশ: দশম শ্রেণি: পশ্চিমবঙ্গ মধ্যশিক্ষা পর্ষদ
ইসলামিক বই
ইসলামে আকীকা
ইসলামে নারী
এসো আরবী শিখি
কুরআন
খাদ্য, পুষ্টি ও খাদ্যের উপাদান
জীবনবিজ্ঞান ও পরিবেশ (দশম)
তাহারাত কুইজ প্রতিযোগিতা
নবীদের কাহিনী - The story of the prophets
পরিবেশ ও বিজ্ঞান
প্যারেন্টিং - Parenting
প্রচলিত ভুল বিষয়ে প্রতিযোগিতা টেস্ট কুইজ
প্রশ্নোত্তরে ইসলামী জ্ঞান
বাংলা ইসলামিক কুইজ - Bangla Islamic Quiz
বাংলা সাহিত্য
ব্যক্তিগত উন্নয়ন (Personal Development)
ভূগোল
মডার্ন কম্পিউটার অ্যাপ্লিকেশন - একাদশ শ্রেণী
মডার্ন কম্পিউটার অ্যাপ্লিকেশন - দ্বাদশ শ্রেণী
লেখক এবং কবি
শয়তান পরিচিতি
সংক্ষিপ্ত জীবনী
সাধারণ জ্ঞান
সাহাবীদের জীবনী
সীরাত প্রতিযোগিতার প্রশ্ন ও উত্তরসমূহ
Guest
Profile
Logout
Green
Light
Dark
Java Exception MCQ
Answer all questions carefully. After submission, you will see a detailed result and answer review.
Question 1
What happen in case of multiple catch blocks?
A.
Either super or subclass can be caught first.
B.
The superclass exception must be caught first.
C.
The superclass exception cannot caught first.
D.
None of these
Question 2
System class is defined in .................
A.
java.util package
B.
java.lang package
C.
java.io package
D.
java.awt package
Question 3
Which keyword is used to specify the exception thrown by the method?
A.
catch
B.
throws
C.
finally
D.
throw
Question 4
What will be the output of the following piece of code: <pre class="prettyprint"> class Person{ public void talk() {} } public class Test{ public static void main(String args[]){ Person p = null; try{ p.talk(); } catch(NullPointerException e){ System.out.print("There is a NullPointerException. "); } catch(Exception e){ System.out.print("There is an Exception. "); } System.out.print("Everything went fine. "); } } </pre>
A.
There is a NullPointerException. Everything went fine.
B.
There is a NullPointerException.
C.
There is a NullPointerException. There is an Exception.
D.
This code will not compile, because in Java there are no pointers.
Question 5
Exception generated in try block is caught in ........... block.
A.
catch
B.
throw
C.
throws
D.
finally
Question 6
What will be the output? <pre class="prettyprint"> class MyClass{ public String test(){ try{ System.out.print("One"); return ""; } finally{ System.out.print("Two"); } } } public class Test{ public static void main(String args[]){ MyClass m = new MyClass(); m.test(); } } </pre>
A.
One
B.
Two
C.
One Two
D.
Compilation Error
Question 7
Determine output of the following program code? <pre class="prettyprint"> public class Test{ public static void main(String args[]){ int i; try{ i = calculate(); System.out.println(i); }catch(Exception e){ System.out.println("Error occured"); } } static int calculate(){ return (7/2); } } </pre>
A.
3
B.
3.5
C.
Error occured
D.
Compilation Error
Question 8
What will be the result after the class Test execution? <pre class="prettyprint"> class A{ public void doA(){ B b = new B(); b.dobB(); System.out.print("doA"); } } class B{ public void dobB(){ C c = new C(); c.doC(); System.out.print("doB"); } } class C{ public void doC(){ if(true) throw new NullPointerException(); System.out.print("doC"); } } public class Test{ public static void main(String args[]){ try{ A a = new A(); a.doA(); }catch(Exception ex){ System.out.print("error"); } } } </pre>
A.
"doCdoBdoA" is printed
B.
"doAdoBdoC" is printed
C.
"doBdoAerror" is printed
D.
"error" is printed
Question 9
Which of the below statement is/are true about Error? <p>A. An Error is a subclass of Throwable.<br />B. An Error is a subclass of Exception.<br />C. Error indicates serious problems that a reasonable application should not try to catch.<br />D. An Error is a subclass of IOException.</p>
A.
A and D
B.
A and B
C.
A and C
D.
B and C
Question 10
In which of the following package Exception class exist?
A.
java.util
B.
java.file
C.
java.io
D.
java.lang
Submit Quiz