SlideShare una empresa de Scribd logo
1 de 13
Exception Handling, I/O Streams, and
          Applets




                                       1
Objectives

On completion of this period, you would be able
 to know:
• The sources of errors




                                                  2
Recap

• In the previous classes, you have studied
  about
  • Packages
  • Interfaces
  • Multithreaded programming




                                              3
Source of Errors

• There are several types of errors, each with its
  own method of detection and repair mechanism
• The basic types of error are
  •   Syntax errors
  •   Runtime errors
  •   Logic errors
  •   Incorrect operator precedence errors
  •   Threading errors



                                                     4
Syntax Errors

• These are errors due to
  • Grammar
  • Punctuation such as mismatched quotes, missed
    commas
  • Case-sensitivity issues
• These errors are caught by the javac compiler




                                                    5
Runtime Errors

• These errors only show up as the program is
  executed
• A common example is division by zero




                                                6
Logic Errors

• These are basic errors in the programmer's
  algorithms or procedural errors
• Diagnosis only comes when incorrect results
  occur
• An example is wrong scoping of a variable




                                            7
Incorrect Operator Precedence Errors

• These are basic mathematical grouping errors
• The best way to avoid them is with brackets to
  force the grouping explicitly




                                               8
Threading Errors

• These errors can occur when multiple threads
  are programmed
• Common issues are access, deadlock, data
  race and synchronization
• These types of errors are very difficult to trace




                                                  9
Discussion
•   List the common errors you encountered
    •   Spelling and typos
    •   Brackets or quotes not matched
    •   Wrong type of bracket. Each has its own use
    •   Not using the escaper backslash when required
    •   Un-initialized variables may be referenced
        accidentally
    •   Arrays bounds related
    •   The type of the variable may be critical
    •   Casting a variable can cause loss of accuracy
    •   The scope of a variable can affect its current value



                                                               10
Summary

•   In this class we discussed various types of
    errors. They are
    • Syntax errors
    • Runtime errors
    • Logic errors
    • Incorrect operator precedence errors
    • Threading errors




                                                  11
Quiz

1. Among the following types of errors which one is
    easier to correct
   A. Runtime errors
   B. Syntax errors
   C. Threading errors
   D. Logic errors




                                                 12
Frequently Asked Questions

1. Explain about various sources of errors




                                             13

Más contenido relacionado

Similar a Exception handling.41

exception-handling-in-java.ppt unit 2
exception-handling-in-java.ppt unit 2exception-handling-in-java.ppt unit 2
exception-handling-in-java.ppt unit 2thenmozhip8
 
exception-handling-in-java.ppt
exception-handling-in-java.pptexception-handling-in-java.ppt
exception-handling-in-java.pptJAYESHRODGE
 
Software_Testing_Overview.pptx
Software_Testing_Overview.pptxSoftware_Testing_Overview.pptx
Software_Testing_Overview.pptxJayPrakash255
 
Exception handling
Exception handlingException handling
Exception handlingMinal Maniar
 
Exception handling in c++ by manoj vasava
Exception handling in c++ by manoj vasavaException handling in c++ by manoj vasava
Exception handling in c++ by manoj vasavaManoj_vasava
 
The Psychology of C# Analysis
The Psychology of C# AnalysisThe Psychology of C# Analysis
The Psychology of C# AnalysisCoverity
 
Exception handling
Exception handlingException handling
Exception handlingRavi Sharda
 
Exception handling
Exception handlingException handling
Exception handlingpooja kumari
 
An Introduction To Software Development - Implementation
An Introduction To Software Development - ImplementationAn Introduction To Software Development - Implementation
An Introduction To Software Development - ImplementationBlue Elephant Consulting
 
Fixing the program my computer learned: End-user debugging of machine-learned...
Fixing the program my computer learned: End-user debugging of machine-learned...Fixing the program my computer learned: End-user debugging of machine-learned...
Fixing the program my computer learned: End-user debugging of machine-learned...City University London
 
Error detection recovery
Error detection recoveryError detection recovery
Error detection recoveryTech_MX
 
Exceptions in Java
Exceptions in JavaExceptions in Java
Exceptions in JavaVadym Lotar
 
Fighting Software Inefficiency Through Automated Bug Detection
 Fighting Software Inefficiency Through Automated Bug Detection Fighting Software Inefficiency Through Automated Bug Detection
Fighting Software Inefficiency Through Automated Bug DetectionMd E. Haque
 
The View - 30 proven Lotuscript tips
The View - 30 proven Lotuscript tipsThe View - 30 proven Lotuscript tips
The View - 30 proven Lotuscript tipsBill Buchan
 
Entomology 101
Entomology 101Entomology 101
Entomology 101snyff
 
Types of exceptions
Types of exceptionsTypes of exceptions
Types of exceptionsmyrajendra
 
Reading Notes : the practice of programming
Reading Notes : the practice of programmingReading Notes : the practice of programming
Reading Notes : the practice of programmingJuggernaut Liu
 
Introduction to java exceptions
Introduction to java exceptionsIntroduction to java exceptions
Introduction to java exceptionsSujit Kumar
 

Similar a Exception handling.41 (20)

exception-handling-in-java.ppt unit 2
exception-handling-in-java.ppt unit 2exception-handling-in-java.ppt unit 2
exception-handling-in-java.ppt unit 2
 
PHP - Introduction to PHP Bugs - Debugging
PHP -  Introduction to  PHP Bugs - DebuggingPHP -  Introduction to  PHP Bugs - Debugging
PHP - Introduction to PHP Bugs - Debugging
 
exception-handling-in-java.ppt
exception-handling-in-java.pptexception-handling-in-java.ppt
exception-handling-in-java.ppt
 
Software_Testing_Overview.pptx
Software_Testing_Overview.pptxSoftware_Testing_Overview.pptx
Software_Testing_Overview.pptx
 
Exception handling
Exception handlingException handling
Exception handling
 
Exception handling in c++ by manoj vasava
Exception handling in c++ by manoj vasavaException handling in c++ by manoj vasava
Exception handling in c++ by manoj vasava
 
The Psychology of C# Analysis
The Psychology of C# AnalysisThe Psychology of C# Analysis
The Psychology of C# Analysis
 
Exception handling
Exception handlingException handling
Exception handling
 
Exception handling
Exception handlingException handling
Exception handling
 
An Introduction To Software Development - Implementation
An Introduction To Software Development - ImplementationAn Introduction To Software Development - Implementation
An Introduction To Software Development - Implementation
 
Fixing the program my computer learned: End-user debugging of machine-learned...
Fixing the program my computer learned: End-user debugging of machine-learned...Fixing the program my computer learned: End-user debugging of machine-learned...
Fixing the program my computer learned: End-user debugging of machine-learned...
 
Error detection recovery
Error detection recoveryError detection recovery
Error detection recovery
 
Exceptions in Java
Exceptions in JavaExceptions in Java
Exceptions in Java
 
Fighting Software Inefficiency Through Automated Bug Detection
 Fighting Software Inefficiency Through Automated Bug Detection Fighting Software Inefficiency Through Automated Bug Detection
Fighting Software Inefficiency Through Automated Bug Detection
 
The View - 30 proven Lotuscript tips
The View - 30 proven Lotuscript tipsThe View - 30 proven Lotuscript tips
The View - 30 proven Lotuscript tips
 
Entomology 101
Entomology 101Entomology 101
Entomology 101
 
Types of exceptions
Types of exceptionsTypes of exceptions
Types of exceptions
 
java Features
java Featuresjava Features
java Features
 
Reading Notes : the practice of programming
Reading Notes : the practice of programmingReading Notes : the practice of programming
Reading Notes : the practice of programming
 
Introduction to java exceptions
Introduction to java exceptionsIntroduction to java exceptions
Introduction to java exceptions
 

Más de myrajendra (20)

Fundamentals
FundamentalsFundamentals
Fundamentals
 
Data type
Data typeData type
Data type
 
Hibernate example1
Hibernate example1Hibernate example1
Hibernate example1
 
Jdbc workflow
Jdbc workflowJdbc workflow
Jdbc workflow
 
2 jdbc drivers
2 jdbc drivers2 jdbc drivers
2 jdbc drivers
 
3 jdbc api
3 jdbc api3 jdbc api
3 jdbc api
 
4 jdbc step1
4 jdbc step14 jdbc step1
4 jdbc step1
 
Dao example
Dao exampleDao example
Dao example
 
Sessionex1
Sessionex1Sessionex1
Sessionex1
 
Internal
InternalInternal
Internal
 
3. elements
3. elements3. elements
3. elements
 
2. attributes
2. attributes2. attributes
2. attributes
 
1 introduction to html
1 introduction to html1 introduction to html
1 introduction to html
 
Headings
HeadingsHeadings
Headings
 
Forms
FormsForms
Forms
 
Css
CssCss
Css
 
Views
ViewsViews
Views
 
Views
ViewsViews
Views
 
Views
ViewsViews
Views
 
Starting jdbc
Starting jdbcStarting jdbc
Starting jdbc
 

Exception handling.41

  • 1. Exception Handling, I/O Streams, and Applets 1
  • 2. Objectives On completion of this period, you would be able to know: • The sources of errors 2
  • 3. Recap • In the previous classes, you have studied about • Packages • Interfaces • Multithreaded programming 3
  • 4. Source of Errors • There are several types of errors, each with its own method of detection and repair mechanism • The basic types of error are • Syntax errors • Runtime errors • Logic errors • Incorrect operator precedence errors • Threading errors 4
  • 5. Syntax Errors • These are errors due to • Grammar • Punctuation such as mismatched quotes, missed commas • Case-sensitivity issues • These errors are caught by the javac compiler 5
  • 6. Runtime Errors • These errors only show up as the program is executed • A common example is division by zero 6
  • 7. Logic Errors • These are basic errors in the programmer's algorithms or procedural errors • Diagnosis only comes when incorrect results occur • An example is wrong scoping of a variable 7
  • 8. Incorrect Operator Precedence Errors • These are basic mathematical grouping errors • The best way to avoid them is with brackets to force the grouping explicitly 8
  • 9. Threading Errors • These errors can occur when multiple threads are programmed • Common issues are access, deadlock, data race and synchronization • These types of errors are very difficult to trace 9
  • 10. Discussion • List the common errors you encountered • Spelling and typos • Brackets or quotes not matched • Wrong type of bracket. Each has its own use • Not using the escaper backslash when required • Un-initialized variables may be referenced accidentally • Arrays bounds related • The type of the variable may be critical • Casting a variable can cause loss of accuracy • The scope of a variable can affect its current value 10
  • 11. Summary • In this class we discussed various types of errors. They are • Syntax errors • Runtime errors • Logic errors • Incorrect operator precedence errors • Threading errors 11
  • 12. Quiz 1. Among the following types of errors which one is easier to correct A. Runtime errors B. Syntax errors C. Threading errors D. Logic errors 12
  • 13. Frequently Asked Questions 1. Explain about various sources of errors 13