stud
bud
Sign up
Log in
Home
Library
Explore
SAT
More
Java Ch. 2 Test Review Flashcards | StudBud
Explore
/
Java Ch. 2 Test Review
Java Ch. 2 Test Review
30 terms
·
StudBud Administration
·
233 plays
Imported from external platform
Flashcards
30 cards
F
Practice quiz
P
Host live
L
Questions
30
Answers
1
What is the proper way to write the main() method heading?
public static void main(string[ ] args)
public static void main(String[ ] args)
public static main(String[ ] args)
public static void Main (String [ ] args)
2
A program consists of a set of instructions called
methods
objects
statements
comments
3
Which of the following describes a set of guidelines for writing an application?
code conventions
comments
pseudocode
algorithm
4
You will always have at least one class in a Java application.
True
False
5
In a format string specifier, a positive number indicates left alignment.
True
False
6
print() will display output then move the insertion point to the next line.
False
True
7
The print() and println() methods are exactly the same thing.
True
False
8
Which process converts source code to machine code?
compiling
executing
interpreting
running
9
Java is an object-oriented programming language.
False
True
10
If the width in a format string specifier is not long enough for the longest string, an error will occur.
False
True
11
Machine code is binary code.
False
True
12
Source code that has been compiled will have the .class extension.
False
True
13
If your code contains syntax errors, the program will not compile.
True
False
14
Source code files have the extension .java.
False
True
15
Comments interfere with program execution.
True
False
16
Given the following code, how will the output be displayed?
Name and Age will be right aligned
Name and Age will be left aligned.
Name will be right aligned and Age will be left aligned.
Name will be left aligned and Age will be right aligned.
17
Statements must end with a semi-colon.
False
True
18
A package is also called a/an
class
object
method
library
19
An interpreter is software that runs each bytecode instruction of a compiled Java program.
False
True
20
Which character is an escape sequence?
\
|
"
/
21
When a Java application is run, the code in the main() method is automatically executed.
False
True
22
What do you call compiled Java source code?
compiled code
bytecode
machine code
source code
23
When writing an algorithm, which one uses a mix of english and program code?
source code
pseudocode
steps
Java code
24
println() and \n both move the insertion point to the next line.
False
True
25
Which of the following is used for documentation comments?
/** */
//
/* */
/
26
Which method controls the way output is displayed?
print()
format()
main()
println()
27
The format() method is useful for controlling the way output is displayed.
False
True
28
In Java, the System class contains methods for displaying output
False
True
29
Which is not a valid Java comment?
// comment
/* comment */
**comment
/** comment */
30
Platform-independent applications can be run on any operating system.
True
False