Thompson Rivers University, COMP
1131 Question and answers 100%
correct 2025
Syntax rules dictate the form of a program. Semantics dictate the meaning of
the program statements. - correct answer ✔True
Variables declared with the final modifier cannot have new values assigned to
them. - correct answer ✔True
Comments affect the run-time execution of a program. - correct answer
✔False
An identifier can begin with a digit. - correct answer ✔False
Consider the expression: result = 14 % 4; What value stored in result after this
line is executed? - correct answer ✔2
Consider the expression: result = 12 + ; What value stored in result after
this line is executed? - correct answer ✔14
Java is a(n)_____________________. - correct answer ✔object-oriented
language
Which of the following might be included in an IDE? - correct answer ✔a
compiler, an editor, and a debugger
, In Java, all decimal literals like 3.141593 are assumed to be of type float. -
correct answer ✔False, they are assumed to be of type double
Java uses the ASCII character set to represent character data. - correct
answer ✔False
_____________ consists of specific words and symbols to express problem
solutions. - correct answer ✔A programming language
Which of the following is an example of an invalid assignment or declaration
statement? - correct answer ✔int years = 1; months = 12; days = 365;.When
declaring multiple variables, you use a , to separate them. If you use a ; then
you need to include the data type, since there are separate statements.
A syntax error is a(n) _____________________. - correct answer ✔compile-
time error
Which of the following describes the act of ensuring that a program solves the
intended problem in all cases? - correct answer ✔Testing
The _____________ of an object define(s) its potential behaviours. - correct
answer ✔Methods
The print and the println methods are identical and can be used
interchangeably. - correct answer ✔False.Both methods output content, but
print does not advance to the next line when done
Consider the following snippet of code: System.out.println("30 plus 25 is " + 30
+ 25); What is printed by this line? - correct answer ✔30 plus 25 is 3025