SlideShare a Scribd company logo
1 of 1
I believe the three types of errors you can run into with a Java program consist of:

1. Syntax Errors
2. Semantic Errors
3. Logic and Runtime Errors

A syntax error is an error that violates the coding rules for the Java language (or
any language for that matter). I believe the most common syntax error, and
speaking from personal experience, is forgetting the end bracket to a statement.
Other common syntax errors include forgetting a semicolon. Forgetting a
semicolon at the end of a statement could potentially cause multiple errors. The
best place to start correcting these errors is with the first one detected in the list, as
it will probably clear other errors out. A great way to combat this problem is to
have a methodology in how you write your code. One habit I've gotten into, is after
I type out a starting bracket for a statement or method, I immediately hit enter a
few times then put the end bracket in. Once I do that I will move my cursor back
up between the brackets and start typing out the logic of that statement.

A semantic error in simple terms changes the meaning of the code to the compiler,
confusing it. I think the most ubiquitous source of these errors (for me) is
inadvertently messing up the names of variables. I tend to follow a specific naming
schema, so all my variables are usually upper-case first word, upperclass second
word, etc. For instance, SalesTax, or EmployeeFirstName, would be my variables.
With that said, I have ran into error issues because I might type a variable
incorrectly like salesTax and it produces an error. I believe only way to prevent
errors (if possible) is to follow a strict naming rubric and maintain attention to
detail as you pound out your code.

The last error is a logic and/or runtime error. These errors result from poor
program design; where the program will successfully compile but still tends to run
improperly. A good example is poor error control and detection. For instance,
suppose I created a program to calculate an employee's monthly paycheck, by
deducting certain taxes from inputting hours and wages. So, let’s say I accidently
inputted for "hours worked" -30 or 1825 hours. Clearly, these inputs are both
impractical, so they will potentially have a problem with some of the other
calculations that will be made once the user enters that information into the
program. The best way to prevent these errors is to slow down and think out your
program thoroughly. Asking a lot of "what ifs" is a great thing to do with every
step in the logic control process. What if I typed in "A" or "dog" for my hours.
Most likely entries like this would not happen but another aspect of other than just
an appropriate range of numbers to be mindful of.

More Related Content

What's hot

How to Build Fit-for-Purpose Excel Models
How to Build Fit-for-Purpose Excel ModelsHow to Build Fit-for-Purpose Excel Models
How to Build Fit-for-Purpose Excel ModelsMoritz Dressel
 
Module 03 communication on internet
Module 03 communication on internetModule 03 communication on internet
Module 03 communication on internetthinkict
 
3 Embarrassing Subject Line Mistakes to Avoid
3 Embarrassing Subject Line Mistakes to Avoid3 Embarrassing Subject Line Mistakes to Avoid
3 Embarrassing Subject Line Mistakes to AvoidChad S. White
 
ML Interview Questions for Product-based companies
ML Interview Questions for Product-based companiesML Interview Questions for Product-based companies
ML Interview Questions for Product-based companiesLearnbay Datascience
 
Email etiquette[1]
Email etiquette[1]Email etiquette[1]
Email etiquette[1]101jennyj
 
If the coding bug is banal, it doesn't meant it's not crucial
If the coding bug is banal, it doesn't meant it's not crucialIf the coding bug is banal, it doesn't meant it's not crucial
If the coding bug is banal, it doesn't meant it's not crucialPVS-Studio
 

What's hot (10)

How to Build Fit-for-Purpose Excel Models
How to Build Fit-for-Purpose Excel ModelsHow to Build Fit-for-Purpose Excel Models
How to Build Fit-for-Purpose Excel Models
 
SAP OSS note search
SAP OSS note searchSAP OSS note search
SAP OSS note search
 
Module 03 communication on internet
Module 03 communication on internetModule 03 communication on internet
Module 03 communication on internet
 
3 Embarrassing Subject Line Mistakes to Avoid
3 Embarrassing Subject Line Mistakes to Avoid3 Embarrassing Subject Line Mistakes to Avoid
3 Embarrassing Subject Line Mistakes to Avoid
 
Lindquist and willard tips and tools for electronic feedback
Lindquist and willard  tips and tools for electronic feedbackLindquist and willard  tips and tools for electronic feedback
Lindquist and willard tips and tools for electronic feedback
 
ML Interview Questions for Product-based companies
ML Interview Questions for Product-based companiesML Interview Questions for Product-based companies
ML Interview Questions for Product-based companies
 
Macros
MacrosMacros
Macros
 
ChatCrypt
ChatCryptChatCrypt
ChatCrypt
 
Email etiquette[1]
Email etiquette[1]Email etiquette[1]
Email etiquette[1]
 
If the coding bug is banal, it doesn't meant it's not crucial
If the coding bug is banal, it doesn't meant it's not crucialIf the coding bug is banal, it doesn't meant it's not crucial
If the coding bug is banal, it doesn't meant it's not crucial
 

Viewers also liked

Viewers also liked (13)

Resultados de la encuesta realizada para evaluar cómo realizamos la evaluación
Resultados de la encuesta realizada para evaluar cómo realizamos la evaluaciónResultados de la encuesta realizada para evaluar cómo realizamos la evaluación
Resultados de la encuesta realizada para evaluar cómo realizamos la evaluación
 
Tire moni strip 13 15
Tire moni strip 13 15Tire moni strip 13 15
Tire moni strip 13 15
 
HP's Job Search Tips
HP's Job Search TipsHP's Job Search Tips
HP's Job Search Tips
 
4756
47564756
4756
 
Como subir una presentacion a wikimedia
Como subir una presentacion a wikimediaComo subir una presentacion a wikimedia
Como subir una presentacion a wikimedia
 
Kartu legislatif
Kartu legislatifKartu legislatif
Kartu legislatif
 
母親的借據
母親的借據母親的借據
母親的借據
 
shaikh aleem ahmed
shaikh aleem ahmedshaikh aleem ahmed
shaikh aleem ahmed
 
Ficha susi cala
Ficha susi calaFicha susi cala
Ficha susi cala
 
大蒜殺菌功能強大腸胃病不用愁
大蒜殺菌功能強大腸胃病不用愁大蒜殺菌功能強大腸胃病不用愁
大蒜殺菌功能強大腸胃病不用愁
 
Costumbres indígenas ecuatorianas
Costumbres indígenas ecuatorianasCostumbres indígenas ecuatorianas
Costumbres indígenas ecuatorianas
 
Pre cana
Pre canaPre cana
Pre cana
 
Read this
Read thisRead this
Read this
 

Similar to Week2 dq2

VISUAL_BASIC_LECTURE_NOTE_A_Z_MADE_EASY.pdf
VISUAL_BASIC_LECTURE_NOTE_A_Z_MADE_EASY.pdfVISUAL_BASIC_LECTURE_NOTE_A_Z_MADE_EASY.pdf
VISUAL_BASIC_LECTURE_NOTE_A_Z_MADE_EASY.pdfNALANDACSCCENTRE
 
EDD (Error Driven Development)
EDD (Error Driven Development)EDD (Error Driven Development)
EDD (Error Driven Development)Daniel Andrews
 
Error Correction Techniques
Error Correction TechniquesError Correction Techniques
Error Correction TechniquesKelly Bauer
 
The D language comes to help
The D language comes to helpThe D language comes to help
The D language comes to helpPVS-Studio
 
Introduction to Computer Programming
Introduction to Computer ProgrammingIntroduction to Computer Programming
Introduction to Computer ProgrammingProf. Erwin Globio
 
LabsLab8.htmlLab 8 Im Thinking of a NumberBefore yo.docx
LabsLab8.htmlLab 8 Im Thinking of a NumberBefore yo.docxLabsLab8.htmlLab 8 Im Thinking of a NumberBefore yo.docx
LabsLab8.htmlLab 8 Im Thinking of a NumberBefore yo.docxDIPESH30
 
Static white box testing lecture 12
Static white box testing lecture 12Static white box testing lecture 12
Static white box testing lecture 12Abdul Basit
 
White box testing
White box testingWhite box testing
White box testingAbdul Basit
 
S D D Program Development Tools
S D D  Program  Development  ToolsS D D  Program  Development  Tools
S D D Program Development Toolsgavhays
 
Top 5 performance problems in .net applications application performance mon...
Top 5 performance problems in .net applications   application performance mon...Top 5 performance problems in .net applications   application performance mon...
Top 5 performance problems in .net applications application performance mon...KennaaTol
 
Final requirement for programming-Bonifacio, Mary Clemence
Final requirement for programming-Bonifacio, Mary ClemenceFinal requirement for programming-Bonifacio, Mary Clemence
Final requirement for programming-Bonifacio, Mary Clemenceclemencebonifacio
 
Oracle SOA Suite 11g Troubleshooting Methodology (whitepaper)
Oracle SOA Suite 11g Troubleshooting Methodology (whitepaper)Oracle SOA Suite 11g Troubleshooting Methodology (whitepaper)
Oracle SOA Suite 11g Troubleshooting Methodology (whitepaper)Revelation Technologies
 
How to fix bug or defects in software
How to fix bug or defects in software How to fix bug or defects in software
How to fix bug or defects in software Rajasekar Subramanian
 
Unit 1-problem solving with algorithm
Unit 1-problem solving with algorithmUnit 1-problem solving with algorithm
Unit 1-problem solving with algorithmrajkumar1631010038
 
Static analysis and ROI
Static analysis and ROIStatic analysis and ROI
Static analysis and ROIPVS-Studio
 
Static analysis and ROI
Static analysis and ROIStatic analysis and ROI
Static analysis and ROIAndrey Karpov
 
It is difficult
It is difficultIt is difficult
It is difficultPVS-Studio
 

Similar to Week2 dq2 (20)

VISUAL_BASIC_LECTURE_NOTE_A_Z_MADE_EASY.pdf
VISUAL_BASIC_LECTURE_NOTE_A_Z_MADE_EASY.pdfVISUAL_BASIC_LECTURE_NOTE_A_Z_MADE_EASY.pdf
VISUAL_BASIC_LECTURE_NOTE_A_Z_MADE_EASY.pdf
 
EDD (Error Driven Development)
EDD (Error Driven Development)EDD (Error Driven Development)
EDD (Error Driven Development)
 
Error Correction Techniques
Error Correction TechniquesError Correction Techniques
Error Correction Techniques
 
The D language comes to help
The D language comes to helpThe D language comes to help
The D language comes to help
 
grade 10 2023.pptx
grade 10 2023.pptxgrade 10 2023.pptx
grade 10 2023.pptx
 
Introduction to Computer Programming
Introduction to Computer ProgrammingIntroduction to Computer Programming
Introduction to Computer Programming
 
LabsLab8.htmlLab 8 Im Thinking of a NumberBefore yo.docx
LabsLab8.htmlLab 8 Im Thinking of a NumberBefore yo.docxLabsLab8.htmlLab 8 Im Thinking of a NumberBefore yo.docx
LabsLab8.htmlLab 8 Im Thinking of a NumberBefore yo.docx
 
Static white box testing lecture 12
Static white box testing lecture 12Static white box testing lecture 12
Static white box testing lecture 12
 
White box testing
White box testingWhite box testing
White box testing
 
S D D Program Development Tools
S D D  Program  Development  ToolsS D D  Program  Development  Tools
S D D Program Development Tools
 
Top 5 performance problems in .net applications application performance mon...
Top 5 performance problems in .net applications   application performance mon...Top 5 performance problems in .net applications   application performance mon...
Top 5 performance problems in .net applications application performance mon...
 
Final requirement for programming-Bonifacio, Mary Clemence
Final requirement for programming-Bonifacio, Mary ClemenceFinal requirement for programming-Bonifacio, Mary Clemence
Final requirement for programming-Bonifacio, Mary Clemence
 
Oracle SOA Suite 11g Troubleshooting Methodology (whitepaper)
Oracle SOA Suite 11g Troubleshooting Methodology (whitepaper)Oracle SOA Suite 11g Troubleshooting Methodology (whitepaper)
Oracle SOA Suite 11g Troubleshooting Methodology (whitepaper)
 
Switch case looping
Switch case loopingSwitch case looping
Switch case looping
 
How to fix bug or defects in software
How to fix bug or defects in software How to fix bug or defects in software
How to fix bug or defects in software
 
Unit 1-problem solving with algorithm
Unit 1-problem solving with algorithmUnit 1-problem solving with algorithm
Unit 1-problem solving with algorithm
 
Static analysis and ROI
Static analysis and ROIStatic analysis and ROI
Static analysis and ROI
 
Static analysis and ROI
Static analysis and ROIStatic analysis and ROI
Static analysis and ROI
 
Error Messages In Software Applications
Error Messages In Software ApplicationsError Messages In Software Applications
Error Messages In Software Applications
 
It is difficult
It is difficultIt is difficult
It is difficult
 

More from amaxwell2012 (9)

Week3 dq4
Week3 dq4Week3 dq4
Week3 dq4
 
Week3 dq1
Week3 dq1Week3 dq1
Week3 dq1
 
Week2 dq4
Week2 dq4Week2 dq4
Week2 dq4
 
Week2 dq3
Week2 dq3Week2 dq3
Week2 dq3
 
Week1 dq5
Week1 dq5Week1 dq5
Week1 dq5
 
Week1 dq3
Week1 dq3Week1 dq3
Week1 dq3
 
Week1 dq2
Week1 dq2Week1 dq2
Week1 dq2
 
Week 4 dq 4
Week 4 dq 4Week 4 dq 4
Week 4 dq 4
 
Week 4 dq 3
Week 4 dq 3Week 4 dq 3
Week 4 dq 3
 

Week2 dq2

  • 1. I believe the three types of errors you can run into with a Java program consist of: 1. Syntax Errors 2. Semantic Errors 3. Logic and Runtime Errors A syntax error is an error that violates the coding rules for the Java language (or any language for that matter). I believe the most common syntax error, and speaking from personal experience, is forgetting the end bracket to a statement. Other common syntax errors include forgetting a semicolon. Forgetting a semicolon at the end of a statement could potentially cause multiple errors. The best place to start correcting these errors is with the first one detected in the list, as it will probably clear other errors out. A great way to combat this problem is to have a methodology in how you write your code. One habit I've gotten into, is after I type out a starting bracket for a statement or method, I immediately hit enter a few times then put the end bracket in. Once I do that I will move my cursor back up between the brackets and start typing out the logic of that statement. A semantic error in simple terms changes the meaning of the code to the compiler, confusing it. I think the most ubiquitous source of these errors (for me) is inadvertently messing up the names of variables. I tend to follow a specific naming schema, so all my variables are usually upper-case first word, upperclass second word, etc. For instance, SalesTax, or EmployeeFirstName, would be my variables. With that said, I have ran into error issues because I might type a variable incorrectly like salesTax and it produces an error. I believe only way to prevent errors (if possible) is to follow a strict naming rubric and maintain attention to detail as you pound out your code. The last error is a logic and/or runtime error. These errors result from poor program design; where the program will successfully compile but still tends to run improperly. A good example is poor error control and detection. For instance, suppose I created a program to calculate an employee's monthly paycheck, by deducting certain taxes from inputting hours and wages. So, let’s say I accidently inputted for "hours worked" -30 or 1825 hours. Clearly, these inputs are both impractical, so they will potentially have a problem with some of the other calculations that will be made once the user enters that information into the program. The best way to prevent these errors is to slow down and think out your program thoroughly. Asking a lot of "what ifs" is a great thing to do with every step in the logic control process. What if I typed in "A" or "dog" for my hours. Most likely entries like this would not happen but another aspect of other than just an appropriate range of numbers to be mindful of.