11/3/2024 10:54 PM
Comp 248 final Exam Study Guide.
Index starts at - answer✔starts at 0
wrapper class def - answer✔A class that contains a primitive type value, such as Integer.
accessor method def - answer✔method that accesses an object and returns some information
about it, without changing the object
constructor method - answer✔A method with the same name as the class that initializes the
instance variables of an object of the class when the object is instantiated.
this parameter - answer✔Within a method definition, you can use the keyword this as a name for
the calling object. If an instance variable or another method in the class is used without any
calling object, then this is understood to be the calling object.
instance variable - answer✔a variable defined in a class for which every object of the class has
its own value
local variable def - answer✔A variable that can only be accessed from a specific portion of a
program
, ©SIRJOEL EXAM SOLUTIONS
11/3/2024 10:54 PM
flow chart def - answer✔A graphical representation of the progress of a system for the definition,
analysis, or solution of a data-processing or manufacturing problem.
numeric type value - answer✔int, byte, long, float, double (all numbers)
logical errors - answer✔Logical errors occur when a programmmer uses a wrong strategy. To the
computer, nothing is wrong with the syntax. The problem is that the instructions are just plain
wrong.
run-time error - answer✔An error in a program that makes it impossible to run to completion.
Also called an "exception". (example: int div. by 0)
Compiler time error - answer✔syntax error, usually the program tells you
object def - answer✔member of the class
methods - answer✔a block of code which only runs when it is called
class - answer✔a blueprint from which individual objects are created
program - answer✔An algorithm that has been coded into something that can be run by a
machine.
pseudocode - answer✔detailed description on how to solve a problem
Algorithm - answer✔a step-by-step procedure for solving a problem
, ©SIRJOEL EXAM SOLUTIONS
11/3/2024 10:54 PM
Java interpreter - answer✔a program that coverts bytecode into machine language and executes
the bytecode instructions line by line
Java compiler - answer✔translates a java source file into a file that contains byte code
instructions
types of errors - answer✔compiler time (syntax), run-time, logic
rules of identifiers - answer✔can contain $ and _ but cannot begin with a digit or symbol and
cannot contain other symbols (&@?!)
%5d - answer✔5 spaces to the end of the number
%.2f - answer✔two digits after decimal point
%7.2d - answer✔7 spaces until the end and two digits after decimal point
is "final" a reserved word in java? - answer✔yes
with which datatype %d - answer✔integer
with which datatype %s - answer✔string
%n - answer✔new line
output of
"Hello%nWorld%n" - answer✔Hello