stud
bud
Sign up
Log in
Home
Library
Explore
SAT
More
Computer Programming Chapter 2 Flashcards | StudBud
Explore
/
Computer Programming Chapter 2
Computer Programming Chapter 2
24 terms
·
StudBud Administration
·
32 plays
CompuScholar Java Programming Chapter 2 Test
Flashcards
24 cards
F
Practice quiz
P
Host live
L
Questions
24
Answers
1
What is the impact of white-space on the compiler?
white-space can be used to terminate statements
white-space can be used to fix errors
white-space is not allowed
none; the compiler ignores white-space
2
Which of the following components is included in the JDK and not the JRE?
“javadoc”, makes HTML documentation from source comments
All of these are included in the JDK and not the JRE
“javac”, compiler that will turn your src code into bytecode
“jar" - bundles many Java .class files in single package
3
Which function declaration below best describes the entry point of your program?
void enter(String[] args)
static int main(String args)
public static void main()
public static void main(String[] args)
4
When was the first version of Java released?
2000s
1990s
1980s
2016
5
What program do you type your source file in?
Docs
Notepad
CMD
Word
6
Which of the following command line statements turns FProgram.java into FProgram.class?
java FProgram
javadoc FProgram.java
java FProgram.java
javac FProgram.java
7
How many independent Java classes can you put within one source file?
0
2
many
1
8
you get a "file not found" error when running "javac HelloWorld.java"
Both are true
Your cmd line is not focused on the dir U thought it was
Neither are true
HelloWorld.java does not exist in the current directory
9
Which of the following best describes the JRE?
JRE - combo of Java Virtual Machine & Java Class Libraries
JRE - runs in your web browser to enable animations
JRE - Oracle Corporation’s name for Java sold at a profit
JRE - development environment in which u type source code
10
How many independent Java classes can you put within one source file?
up to 3
0
as many as you like
1
11
What keyword identifies a group of statements and data that work together as a unit?
class
static
main
package
12
What are some possible causes of compile-time syntax errors reported by javac?
all of these
missing semi-colons
spelling errors
missing curly braces
13
4
package fuzzy_slippers;
package fuzzy.slippers;
package slippers.fuzzy;
import slippers.fuzzy;
14
What file extension will your Java source files have?
.metdata
.java
.class
.exe
15
What file extension will your Java compiled files have?
.exe
.java
.metadata
.class
16
Why would you want to add comments to a program?
So another programmer can better understand your code
give author of a program & program’s purpose
Neither are correct
Both are correct
17
If your top-level source directory is ROOT, where must the "my.utilities.Thing" be located?
ROOT\my.utilities\Thing.class
ROOT\Thing.java
ROOT\my\utilities\Thing.java
You can place source files wherever you like.
18
After you have built FProgram.class, which of the command line statement will run it?
java FProgram.class
javac FProgram
javadoc FProgram.class
java FProgram
19
Which dir structure would you store Amy.java if src file was part of the a.b.c.d package?
Anywhere you want
d\b\c\a\Amy.java
Store Amy.java in the root of your project
a\b\c\d\Amy.java
20
Which code example below is not valid?
They are the same and do the same thing
int myV; myValue = 1;
int myV = 1;
int myV; myValue = 1;
21
The name of the class in your source code is Test, what is the corresponding *.java fname be?
Anything u like; fnames don't have to 2 match the class name
Test_Class.java
Class_Test.java
Test.java
22
How would you write a single-line comment with the text "explanation" ?
' explanation
// explanation
"explanation"
<! explanation !>
23
How do you start and end a multi-line comment?
// //
{ }
/* */
*/ /*
24
What are some possible causes of compile-time syntax errors reported by javac?
missing curly braces
missing semi-colons
All of these
spelling errors