Prg420 Week2 Dq's
Autor: rita • July 15, 2012 • Essay • 325 Words (2 Pages) • 3,235 Views
WK2 DQ1
What are the three types of errors that you can encounter in a Java™ program? Describe them, and explain how you would minimize the errors. What are some examples of errors that you have seen before?
System Errors:
System errors generally happen in the console at the command line. This can generally happen if the program was not installed correctly, or if the path is not set. File names are also a possibility for system errors. If you are using more complex or hard to remember names a simple typo will cause a system error and the program will be unable to produce.
Syntax Errors:
Syntax errors are specific errors in the code. When you have a syntax error it prevents the code from compiling and being readable. A syntax error can be a typo, misspelling, line indentation, and capitalization. These are just to name a few. The syntax error can be caused without your knowing.
Semantic Errors:
Semantic errors can be caused by not declaring an object properly, or list implications. The best way to prevent this is to properly address the object.
I think at one point or another most people have encountered one of these errors. I have had syntax errors before when I did not download a program properly. I did not realize it, and at that time it took me a bit to realize it, but it can be easily adjusted and fixed when you know what you are looking for.
WK2 DQ2
A class is a blueprint for an object. A class may have a default constructor, a constructor with arguments, accessor methods, mutator methods, public fields, and private fields. Choose a category (such as animal, vehicle, and so on) and describe how you would design a class for it.
In our reading it states "a class is not an object,
...