Programming and Problem Solving with Java

(やまだぃちぅ) #1

92


(9) A program that translates assembly language instructions into machine
code
(10) When the compiled version of a program is being run
(11) A place in memory where a data value that can be changed is stored
(12) When a program in a high-level language is converted into machine code
or Bytecode
(13) A part of the computer that can hold both program and data
(14) Instructions for solving a problem in a finite amount of time with a fi-
nite amount of data
(15) Data type specifications and instructions used by a computer to solve a
problem
4.Which of the following are reserved words and which are programmer-defined
identifiers?
Reserved Programmer-Defined
a. char ______ ______
b. sort ______ ______
c. INT ______ ______
d. new ______ ______
e. Public ______ ______
5.Reserved words can be used as variable names. (True or False)?
6.In a Java application containing just one method, that method can be named ei-
ther mainor Main. (True or False?)
7.If s1and s2are Stringvariables containing "blue"and "bird", respectively, what
does each of the following statements print?
a.System.out.println("s1 = "+ s1 + "s2 = "+ s2);
b.System.out.println("Result:" + s1 + s2);
c. System.out.println("Result: "+ s1 + s2);
d.System.out.println("Result: "+ s1 + ' '+ s2);
8.Show precisely what is output by the following statement:
System.out.println("A rolling"+
"stone"+
"gathers" +
"no" +
"moss");
9.How many characters can be stored into a variable of type char?
10.How many characters are in the empty string?
Free download pdf