The document discusses exception handling in Java, including:
1) What exceptions are and how exception handling prevents programs from terminating due to exceptions.
2) The main keywords used in exception handling like try, catch, finally, and throws.
3) The exception hierarchy in Java and differences between checked and unchecked exceptions.
4) Examples of built-in exceptions like FileNotFoundException and how to create custom exceptions.
Exceptions are a powerful mechanism for centralized processing of errors and exceptional situations. This mechanism replaces the procedure-oriented method of error handling in which each function returns a code indicating an error or a successful execution.
unit 4 msbte syallbus for sem 4 2024-2025AKSHAYBHABAD5
The Intel 8086 microprocessor, designed by Intel in the late 1970s, is an 8-bit/16-bit microprocessor and the first member of the x86 family of microprocessors1. Here’s a brief overview of its internal architecture:
Complex Instruction Set Computer (CISC) Architecture: The 8086 microprocessor is based on a CISC architecture, which supports a wide range of instructions, many of which can perform multiple operations in a single instruction1.
Bus Interface Unit (BIU): The BIU is responsible for fetching instructions from memory and decoding them, while also managing data transfer between the microprocessor and memory or I/O devices1.
Execution Unit (EU): The EU executes the instructions1.
Memory Segmentation: The 8086 microprocessor has a segmented memory architecture, which means that memory is divided into segments that are addressed using both a segment register and an offset1.
Registers: The 8086 microprocessor has a rich set of registers, including general-purpose registers, segment registers, and special registers
The exception hierarchy
Exception handling fundamentals
Try and catch
The consequences of an uncaught exception
Using multiple catch statements
Catching subclass exceptions
Nested try blocks
Throwing an exception
Re-throwing an exception
Using finally
Using throws
Java’s built-in exception
Creating exception subclasses
JAVA EXCEPTION HANDLING
N.V.Raja Sekhar Reddy
www.technolamp.co.in
Want more interesting...
Watch and Like us @ https://www.facebook.com/Technolamp.co.in
subscribe videos @ http://www.youtube.com/user/nvrajasekhar
Biological screening of herbal drugs: Introduction and Need for
Phyto-Pharmacological Screening, New Strategies for evaluating
Natural Products, In vitro evaluation techniques for Antioxidants, Antimicrobial and Anticancer drugs. In vivo evaluation techniques
for Anti-inflammatory, Antiulcer, Anticancer, Wound healing, Antidiabetic, Hepatoprotective, Cardio protective, Diuretics and
Antifertility, Toxicity studies as per OECD guidelines
Exceptions are a powerful mechanism for centralized processing of errors and exceptional situations. This mechanism replaces the procedure-oriented method of error handling in which each function returns a code indicating an error or a successful execution.
unit 4 msbte syallbus for sem 4 2024-2025AKSHAYBHABAD5
The Intel 8086 microprocessor, designed by Intel in the late 1970s, is an 8-bit/16-bit microprocessor and the first member of the x86 family of microprocessors1. Here’s a brief overview of its internal architecture:
Complex Instruction Set Computer (CISC) Architecture: The 8086 microprocessor is based on a CISC architecture, which supports a wide range of instructions, many of which can perform multiple operations in a single instruction1.
Bus Interface Unit (BIU): The BIU is responsible for fetching instructions from memory and decoding them, while also managing data transfer between the microprocessor and memory or I/O devices1.
Execution Unit (EU): The EU executes the instructions1.
Memory Segmentation: The 8086 microprocessor has a segmented memory architecture, which means that memory is divided into segments that are addressed using both a segment register and an offset1.
Registers: The 8086 microprocessor has a rich set of registers, including general-purpose registers, segment registers, and special registers
The exception hierarchy
Exception handling fundamentals
Try and catch
The consequences of an uncaught exception
Using multiple catch statements
Catching subclass exceptions
Nested try blocks
Throwing an exception
Re-throwing an exception
Using finally
Using throws
Java’s built-in exception
Creating exception subclasses
JAVA EXCEPTION HANDLING
N.V.Raja Sekhar Reddy
www.technolamp.co.in
Want more interesting...
Watch and Like us @ https://www.facebook.com/Technolamp.co.in
subscribe videos @ http://www.youtube.com/user/nvrajasekhar
Biological screening of herbal drugs: Introduction and Need for
Phyto-Pharmacological Screening, New Strategies for evaluating
Natural Products, In vitro evaluation techniques for Antioxidants, Antimicrobial and Anticancer drugs. In vivo evaluation techniques
for Anti-inflammatory, Antiulcer, Anticancer, Wound healing, Antidiabetic, Hepatoprotective, Cardio protective, Diuretics and
Antifertility, Toxicity studies as per OECD guidelines
A review of the growth of the Israel Genealogy Research Association Database Collection for the last 12 months. Our collection is now passed the 3 million mark and still growing. See which archives have contributed the most. See the different types of records we have, and which years have had records added. You can also see what we have for the future.
A workshop hosted by the South African Journal of Science aimed at postgraduate students and early career researchers with little or no experience in writing and publishing journal articles.
This slide is special for master students (MIBS & MIFB) in UUM. Also useful for readers who are interested in the topic of contemporary Islamic banking.
Executive Directors Chat Leveraging AI for Diversity, Equity, and InclusionTechSoup
Let’s explore the intersection of technology and equity in the final session of our DEI series. Discover how AI tools, like ChatGPT, can be used to support and enhance your nonprofit's DEI initiatives. Participants will gain insights into practical AI applications and get tips for leveraging technology to advance their DEI goals.
it describes the bony anatomy including the femoral head , acetabulum, labrum . also discusses the capsule , ligaments . muscle that act on the hip joint and the range of motion are outlined. factors affecting hip joint stability and weight transmission through the joint are summarized.
Exploiting Artificial Intelligence for Empowering Researchers and Faculty, In...Dr. Vinod Kumar Kanvaria
Exploiting Artificial Intelligence for Empowering Researchers and Faculty,
International FDP on Fundamentals of Research in Social Sciences
at Integral University, Lucknow, 06.06.2024
By Dr. Vinod Kumar Kanvaria
MATATAG CURRICULUM: ASSESSING THE READINESS OF ELEM. PUBLIC SCHOOL TEACHERS I...NelTorrente
In this research, it concludes that while the readiness of teachers in Caloocan City to implement the MATATAG Curriculum is generally positive, targeted efforts in professional development, resource distribution, support networks, and comprehensive preparation can address the existing gaps and ensure successful curriculum implementation.
2024.06.01 Introducing a competency framework for languag learning materials ...Sandy Millin
http://sandymillin.wordpress.com/iateflwebinar2024
Published classroom materials form the basis of syllabuses, drive teacher professional development, and have a potentially huge influence on learners, teachers and education systems. All teachers also create their own materials, whether a few sentences on a blackboard, a highly-structured fully-realised online course, or anything in between. Despite this, the knowledge and skills needed to create effective language learning materials are rarely part of teacher training, and are mostly learnt by trial and error.
Knowledge and skills frameworks, generally called competency frameworks, for ELT teachers, trainers and managers have existed for a few years now. However, until I created one for my MA dissertation, there wasn’t one drawing together what we need to know and do to be able to effectively produce language learning materials.
This webinar will introduce you to my framework, highlighting the key competencies I identified from my research. It will also show how anybody involved in language teaching (any language, not just English!), teacher training, managing schools or developing language learning materials can benefit from using the framework.
Introduction to AI for Nonprofits with Tapp NetworkTechSoup
Dive into the world of AI! Experts Jon Hill and Tareq Monaur will guide you through AI's role in enhancing nonprofit websites and basic marketing strategies, making it easy to understand and apply.
3. AGENDA.
• What is Exception
• What is Exception Handling
• Exception Hierarchy in java
• Difference between Exception & Error.
• Types of Exception
• Types of Built-in- Exception
• Create and Handle Exception..
Exception
Exception Hierarchy
Exception Types.
Checked Exception
Unchecked Exception
Create & handle Exception
4. What is Exception
“An exception is an unexpected event, which occurs during the execution of a program i.e., at run
time, that disrupts the normal flow of the program.”
What is Exception handling:
“The Exception Handling in Java is one of the powerful mechanisms to handle the exception. in
program. so that the normal flow of the program can be maintained.”
Purpose:
The purpose of Exception handling is to detect and report an exception so that proper action can be
taken and prevent the program which is automatically terminate or stop the execution because of that
exception
5. Example:
Statement 1;
Statement 2;
Statement 3; (an exception occurs)
Statement 4;
Statement 5;
Suppose there are 5 Statements in a program and there occurs an exception at
Statement 3 the rest of the code of statement 3,4,5 will not be executed. If we
perform exception handling the rest of the statement will be executed.
If Exception occurs then we have two ways;
pass the exception to its caller (using throws keyword)
handle exception (using try, catch and finally keyword)
6. Keyword Used in Exception Handling are given:
Keywords Description
try
Java try block is used to enclose the code that might
throw an exception. The try block must be followed by
catch or finally.
catch
The "catch" block is used to handle the exception. It
must be followed by try block which means we can't
use catch block alone. catch block may be one or more
than one.
finally
The "finally" block is used to execute the necessary
code of the program. It is executed whether an
exception is handled or not.
Throws
The "throws" keyword is used to pass the exception to
its caller. It is always used with method signature.
Throw
“throw” keyword used to create user
define exception. it is used inside the method.
7. Exception Hierarchy in java
In the Java platform, many classes derive directly from Object, other classes derive from some of those
classes, and so on, forming a hierarchy of classes. Object is the parent class of all the classes in java.
8. Difference Between Exception and Error?
Exception Error
Exception occurs due to our Program. Error occurs due to lack of system resources.
Exception can be handled. Error cannot be handled.
Types:
Checked Exception
Unchecked Exception.
Type:
Unchecked Only.
Examples:
Null Pointer Exception, Array Index Out of Bounds
Exception, Class not Found Exception etc.
Examples:
Virtual Machine Error, Stack Over Flow Error,
Assertion Error, Linkage Error, Out of Memory Error,
etc..
10. Difference Between Built In exception and User Defined Exception?
Built In exception User Defined Exception
Built-in exceptions are the exceptions that are
already available in Java libraries.
Built-in exceptions are the exceptions that are not
available in Java libraries.
Predefined exceptions are raised implicitly
(Automatically) by the runtime system.
Predefined exception must be raised explicitly by
throw keyword.
Types:
Checked Exception
Unchecked exception
Types:
unchecked exception
12. Some exception are given:
File Not Found Exception: This Exception is raised when a file is not accessible or does not exist.
IO Exception: It is thrown when an input-output operation failed or interrupted
NoSuchMethodException: It is thrown when accessing a method that is not found.
Interrupted Exception: It is thrown when a thread is waiting, sleeping, or doing some processing, and it is
interrupted.
Checked Exception
“If compiler checks exception, then it is known as checked exception. These exceptions should be either
pass or handled during compile time. If we do not catch or handle them then the compiler will throw a
compilation error. These are the sub classes of the Exception class.”
15. Unchecked Exception
If The compiler does not check exception it is known as unchecked exception. An unchecked exception (also
known as a runtime exception). Exceptions are checked at runtime.
Unchecked exceptions result from faulty logic that can occur anywhere in a software program. For example, if a
developer invokes a method on a null object, an unchecked NullPointerException occurs.
Arithmetic Exception: It is thrown when an exceptional condition has occurred in an arithmetic operation.
Array Index Out Of Bounds Exception: it occurs if we print out of bound array in program.
Class Not Found Exception: it is occur if we delete the class of java file after comile.
NoSuchMethodException: It is thrown when accessing a method that is not found.
String Index out of Bounds Exception: It is thrown by String class methods to indicate that an index is either
negative or greater than the size of the string
Some exception are given: