Chapter 1 Flashcards
What is an Identifier?
An identifier is a “word” in a program. It can be made up of letters, digits, the underscore character and the dollar sign. They cannot begin with a digit.
Is Java case sensitive?
Yes, it is. By convention certain case styles are used for different types of identifiers:
- Class name: Lincoln
- Constants: MAXIMUM
- Variable = radius.
What is a reserved word?
It’s a word that has already a predifinied function in the language. It cannot be used in any other way.
What are the four programming language levels?
- Machine language (0s and 1s)
- Assenbly language (bunch of characters put together)
- High-level language (such as Java, Python, ecc.)
- Fourth-generation language
What is a compiler?
A compiler is a software tool which translates source code into a specific target language. This is the approach taken by most programming languages.
What is a bytecode?
A bytecode is the source code translated from the Java compiler. It’s used to allow any interpreter on any computer to transform the bytecode into machine language.
What types of errors do exist?
Three types of errors do exist:
- Compile-time errors: these are errors derivaring from incorrect syntax or logical problems at the Java level (incorrect use of variables/classes/objects).
- Run-time errors: these are errors that occur during the execution of a program. These might include dividing by 0 for example.
- Logical errors: these are the worst errors to encounter into. Java read everything correctly and no operational errors were encountered, but the result is wrong or unexpected from the human side. This means that the list of commands, albeit written correctly, doesn’t correspond to what we want from the program.
What is the difference between classes and objects in Java?
An object is defined by a class, it's a single instance, while a class is the blueprint of an object that is still the same although with different objects. (The class is the employee, while object is a specific employee)