Deck 1: Creating Your First Java Classes

Full screen (f)
exit full mode
Question
Given the statement:   System.out.println("First Java application"); out refers to ____.

A) the screen
B) the standard output device
C) the printer
D) the keyboard
Use Space or
up arrow
down arrow
to flip the card.
Question
Locating and repairing all syntax errors is part of the process of ____ a program.

A) interpreting
B) compiling
C) debugging
D) executing
Question
____ are pieces of information that are sent into, or passed to, a method, usually because the method requires the information to perform its task or carry out its purpose.

A) Applets
B) Methods
C) Arguments
D) Objects
Question
In Java, the reserved keyword ____ means that a method is accessible and usable even though no objects of the class exist.

A) active
B) undefined
C) static
D) void
Question
When you issue the command to compile a class containing errors, the Java compiler does not produce any error messages. You will first need to run the class in order to see error messages.
Question
A Java identifier can contain only letters, digits, ampersands, or number signs.
Question
Dots (or periods) in a Java statement are used to separate the names of the components that make up the statement.
Question
If an object's methods are well written, the user is unaware of the low-level details of how the methods are executed, and the user must simply understand the interface or interaction between the method and the object.
Question
System software is used for tasks such as word processing, calculations and playing games.
Question
A(n) ____ defines the circumstances under which a class can be accessed and the other classes that have the right to use a class.

A) identifier
B) access specifier
C) parameter
D) Pascal casing
Question
Using the void keyword in the main() method header indicates that a value will be returned by the main() method is called.
Question
A compiler ignores whitespace (that is, any combination of nonprinting characters) between words and lines.
Question
Although not a requirement, it is Java standard that class identifiers begin with an uppercase letter and use other uppercase letters to improve readability.
Question
____ describes the feature of languages that allows the same word to be interpreted correctly in different situations based on the context.

A) Polymorphism
B) Architecturally neutral
C) Source code
D) Insulation
Question
You must use the Java interpreter to translate the bytecode into executable statements before running a Java application.
Question
____ refers to the hiding of data and methods within an object.

A) Instance
B) Inheritance
C) Passed
D) Encapsulation
Question
A program written in ____ is the most basic circuitry-level language.

A) Java
B) machine language
C) BASIC
D) C
Question
Logic errors are easily identified when a program is compiled.
Question
Line comments start with ____.

A) a forward slash and an asterisk
B) two forward slashes
C) a forward slash and two asterisks
D) a percent sign
Question
____ are also called modules, methods, functions, and subroutines. Java programmers most frequently use the term "method."

A) Procedures
B) Calls
C) Classes
D) Applications
Question
After a successful compile, you can run the class file on any computer that has a ____.

A) Java language interpreter
B) Web browser
C) text editor
D) DOS
Question
You use an  import  statement when you want to access a built-in Java class that is contained in a group of classes called a(n) ____.

A) JGroup
B) JImport
C) package
D) GUI
Question
A ____ is an error not detected until the program asks the computer to do something wrong, or even illegal, while executing.

A) syntax error
B) run-time error
C) package
D) Java API
Question
In programming, named computer memory locations are called ____because they hold values that might vary.

A) constants
B) variables
C) strings
D) addresses
Question
Whenever a method requires multiple arguments, the arguments are always separated with ____.

A) commas
B) periods
C) forward slashes
D) brackets
Question
In a ____ environment, you can change directories using the cd command. For example, to change to a directory named MyClasses , you type cd MyClasses and press Enter.

A) Windows
B) Java
C) graphical
D) DOS
Question
   public class First    {
     public static void main(String[] args)
     {
        System.out.println("First Java application");
     }
   }
Given the above code, which item identifies the method's return type?

A) public
B) static
C) void
D) println
Question
____ is the process the compiler uses to divide your source code into meaningful portions; the message means that the compiler was in the process of analyzing the code when the end of the file was encountered prematurely.

A) Running
B) Debugging
C) Compiling
D) Parsing
Question
If you receive an error that states, "Exception in thread 'main' java.lang.NoClassDefFoundError," when you try to execute the application, you probably do not have your ____ set correctly.

A) class length
B) class path
C) java
D) object
Question
Java contains a class named ____ that allows you to produce dialog boxes.

A) JBox
B) JOptionPane
C) JDialog
D) JGUI
Question
public class First {
   public static void main(String[] args)
   {
      System.out.println("First Java application");
   }
}
Given the above code, which item identifies the name of the class?

A) public
B) static
C) void
D) First
Question
   public class First    {
     public static void main(String[] args)
     {
        System.out.println("First Java application");
     }
   }
Given the above code, which item identifies that the method will work without instantiating an object of the class?

A) public
B) static
C) void
D) println
Question
A(n) ____ error occurs when the syntax of the program is correct and the program compiles but produces incorrect results when you execute it.

A) logic
B) syntax
C) JVM
D) class
Question
____ comments are a special case of block comments that are used to generate documentation.

A) Line comments
B) Doc comments
C) JDoc
D) Javadoc
Question
It is a tradition among programmers that the first program you write in any language produces "____" as its output.

A) Hi, your name!
B) Hello, world!
C) My first program!
D) Hello, your name!
Question
{ public static void main(String[] args)
   {
      System.out.println("First Java application");
   }
}
Given the above code, which item identifies the access specifier?

A) public
B) static
C) void
D) First
Question
If a compiler detects a violation of language rules, it refuses to translate the class to ____.

A) an application
B) a logic error
C) machine code
D) Java
Question
When you run a Java application using the ____ command, do not add the .class extension to the filename.

A) class
B) static
C) java
D) output
Question
It is best to use the ____ available text editor when writing Java programs.

A) most complex
B) simplest
C) best
D) latest
Question
The ____ is also called the Java class library; it contains information about how to use every prewritten Java class, including lists of all the methods you can use with the classes.

A) Java package
B) Java Interface
C) Java SDK
D) Java API
Question
Match between columns
The characteristics that define an object
literal string
The characteristics that define an object
high-level programming languages
The characteristics that define an object
dialog box
The characteristics that define an object
syntax
The characteristics that define an object
whitespace
The characteristics that define an object
compiler
The characteristics that define an object
attributes
The characteristics that define an object
Machine language
The characteristics that define an object
Java virtual machine (JVM)
The characteristics that define an object
debugging
The characteristics that define an object
javadoc
The characteristics that define an object
encapsulation
The characteristics that define an object
inheritance
The characteristics that define an object
polymorphism
The characteristics that define an object
method
Question
Match between columns
Any combination of nonprinting characters
literal string
Any combination of nonprinting characters
high-level programming languages
Any combination of nonprinting characters
dialog box
Any combination of nonprinting characters
syntax
Any combination of nonprinting characters
whitespace
Any combination of nonprinting characters
compiler
Any combination of nonprinting characters
attributes
Any combination of nonprinting characters
Machine language
Any combination of nonprinting characters
Java virtual machine (JVM)
Any combination of nonprinting characters
debugging
Any combination of nonprinting characters
javadoc
Any combination of nonprinting characters
encapsulation
Any combination of nonprinting characters
inheritance
Any combination of nonprinting characters
polymorphism
Any combination of nonprinting characters
method
Question
Match between columns
Creating classes that share from existing classes
literal string
Creating classes that share from existing classes
high-level programming languages
Creating classes that share from existing classes
dialog box
Creating classes that share from existing classes
syntax
Creating classes that share from existing classes
whitespace
Creating classes that share from existing classes
compiler
Creating classes that share from existing classes
attributes
Creating classes that share from existing classes
Machine language
Creating classes that share from existing classes
Java virtual machine (JVM)
Creating classes that share from existing classes
debugging
Creating classes that share from existing classes
javadoc
Creating classes that share from existing classes
encapsulation
Creating classes that share from existing classes
inheritance
Creating classes that share from existing classes
polymorphism
Creating classes that share from existing classes
method
Question
Match between columns
Hypothetical computer used to run a Java program
literal string
Hypothetical computer used to run a Java program
high-level programming languages
Hypothetical computer used to run a Java program
dialog box
Hypothetical computer used to run a Java program
syntax
Hypothetical computer used to run a Java program
whitespace
Hypothetical computer used to run a Java program
compiler
Hypothetical computer used to run a Java program
attributes
Hypothetical computer used to run a Java program
Machine language
Hypothetical computer used to run a Java program
Java virtual machine (JVM)
Hypothetical computer used to run a Java program
debugging
Hypothetical computer used to run a Java program
javadoc
Hypothetical computer used to run a Java program
encapsulation
Hypothetical computer used to run a Java program
inheritance
Hypothetical computer used to run a Java program
polymorphism
Hypothetical computer used to run a Java program
method
Question
Match between columns
Translates an entire program before carrying out the statement
literal string
Translates an entire program before carrying out the statement
high-level programming languages
Translates an entire program before carrying out the statement
dialog box
Translates an entire program before carrying out the statement
syntax
Translates an entire program before carrying out the statement
whitespace
Translates an entire program before carrying out the statement
compiler
Translates an entire program before carrying out the statement
attributes
Translates an entire program before carrying out the statement
Machine language
Translates an entire program before carrying out the statement
Java virtual machine (JVM)
Translates an entire program before carrying out the statement
debugging
Translates an entire program before carrying out the statement
javadoc
Translates an entire program before carrying out the statement
encapsulation
Translates an entire program before carrying out the statement
inheritance
Translates an entire program before carrying out the statement
polymorphism
Translates an entire program before carrying out the statement
method
Question
Match between columns
The rules for the programming language
literal string
The rules for the programming language
high-level programming languages
The rules for the programming language
dialog box
The rules for the programming language
syntax
The rules for the programming language
whitespace
The rules for the programming language
compiler
The rules for the programming language
attributes
The rules for the programming language
Machine language
The rules for the programming language
Java virtual machine (JVM)
The rules for the programming language
debugging
The rules for the programming language
javadoc
The rules for the programming language
encapsulation
The rules for the programming language
inheritance
The rules for the programming language
polymorphism
The rules for the programming language
method
Question
Match between columns
A GUI object resembling a window in which you can place messages you want to display
literal string
A GUI object resembling a window in which you can place messages you want to display
high-level programming languages
A GUI object resembling a window in which you can place messages you want to display
dialog box
A GUI object resembling a window in which you can place messages you want to display
syntax
A GUI object resembling a window in which you can place messages you want to display
whitespace
A GUI object resembling a window in which you can place messages you want to display
compiler
A GUI object resembling a window in which you can place messages you want to display
attributes
A GUI object resembling a window in which you can place messages you want to display
Machine language
A GUI object resembling a window in which you can place messages you want to display
Java virtual machine (JVM)
A GUI object resembling a window in which you can place messages you want to display
debugging
A GUI object resembling a window in which you can place messages you want to display
javadoc
A GUI object resembling a window in which you can place messages you want to display
encapsulation
A GUI object resembling a window in which you can place messages you want to display
inheritance
A GUI object resembling a window in which you can place messages you want to display
polymorphism
A GUI object resembling a window in which you can place messages you want to display
method
Question
A class named  first  is different from a class named  FIRST because ____.

A) Java is case insensitive
B) it is confusing to have two names that look the same
C) Java is case sensitive
D) first and FIRST are different literal strings
Question
Match between columns
The same word can be used in different situations
literal string
The same word can be used in different situations
high-level programming languages
The same word can be used in different situations
dialog box
The same word can be used in different situations
syntax
The same word can be used in different situations
whitespace
The same word can be used in different situations
compiler
The same word can be used in different situations
attributes
The same word can be used in different situations
Machine language
The same word can be used in different situations
Java virtual machine (JVM)
The same word can be used in different situations
debugging
The same word can be used in different situations
javadoc
The same word can be used in different situations
encapsulation
The same word can be used in different situations
inheritance
The same word can be used in different situations
polymorphism
The same word can be used in different situations
method
Question
Match between columns
Series of characters that will appear in output exactly as entered
literal string
Series of characters that will appear in output exactly as entered
high-level programming languages
Series of characters that will appear in output exactly as entered
dialog box
Series of characters that will appear in output exactly as entered
syntax
Series of characters that will appear in output exactly as entered
whitespace
Series of characters that will appear in output exactly as entered
compiler
Series of characters that will appear in output exactly as entered
attributes
Series of characters that will appear in output exactly as entered
Machine language
Series of characters that will appear in output exactly as entered
Java virtual machine (JVM)
Series of characters that will appear in output exactly as entered
debugging
Series of characters that will appear in output exactly as entered
javadoc
Series of characters that will appear in output exactly as entered
encapsulation
Series of characters that will appear in output exactly as entered
inheritance
Series of characters that will appear in output exactly as entered
polymorphism
Series of characters that will appear in output exactly as entered
method
Question
A(n) ____ is a GUI object resembling a window in which you can place messages you want to display.

A) JDK
B) dialog box
C) variable
D) argument
Question
Match between columns
Placing data and methods within an object
literal string
Placing data and methods within an object
high-level programming languages
Placing data and methods within an object
dialog box
Placing data and methods within an object
syntax
Placing data and methods within an object
whitespace
Placing data and methods within an object
compiler
Placing data and methods within an object
attributes
Placing data and methods within an object
Machine language
Placing data and methods within an object
Java virtual machine (JVM)
Placing data and methods within an object
debugging
Placing data and methods within an object
javadoc
Placing data and methods within an object
encapsulation
Placing data and methods within an object
inheritance
Placing data and methods within an object
polymorphism
Placing data and methods within an object
method
Question
Using the given code, which statement in the  main()  method body will produce the output "Hello to all!". public class Hello
{
   public static void main(String[] args)
   {
       ____
   }
{

A) System.out("Hello to all!");
B) System.println("Hello to all!");
C) println("Hello to all!");
D) System.out.println("Hello to all!");
Question
Programmers use ____ to organize program code and make it easier to read.

A) literal strings
B) whitespace
C) headings
D) FAQs
Question
Match between columns
Self-contained block of code that carries out an action
literal string
Self-contained block of code that carries out an action
high-level programming languages
Self-contained block of code that carries out an action
dialog box
Self-contained block of code that carries out an action
syntax
Self-contained block of code that carries out an action
whitespace
Self-contained block of code that carries out an action
compiler
Self-contained block of code that carries out an action
attributes
Self-contained block of code that carries out an action
Machine language
Self-contained block of code that carries out an action
Java virtual machine (JVM)
Self-contained block of code that carries out an action
debugging
Self-contained block of code that carries out an action
javadoc
Self-contained block of code that carries out an action
encapsulation
Self-contained block of code that carries out an action
inheritance
Self-contained block of code that carries out an action
polymorphism
Self-contained block of code that carries out an action
method
Question
Match between columns
A low-level programming language
literal string
A low-level programming language
high-level programming languages
A low-level programming language
dialog box
A low-level programming language
syntax
A low-level programming language
whitespace
A low-level programming language
compiler
A low-level programming language
attributes
A low-level programming language
Machine language
A low-level programming language
Java virtual machine (JVM)
A low-level programming language
debugging
A low-level programming language
javadoc
A low-level programming language
encapsulation
A low-level programming language
inheritance
A low-level programming language
polymorphism
A low-level programming language
method
Question
Match between columns
Documentation comments
literal string
Documentation comments
high-level programming languages
Documentation comments
dialog box
Documentation comments
syntax
Documentation comments
whitespace
Documentation comments
compiler
Documentation comments
attributes
Documentation comments
Machine language
Documentation comments
Java virtual machine (JVM)
Documentation comments
debugging
Documentation comments
javadoc
Documentation comments
encapsulation
Documentation comments
inheritance
Documentation comments
polymorphism
Documentation comments
method
Question
Match between columns
Repairing syntax errors
literal string
Repairing syntax errors
high-level programming languages
Repairing syntax errors
dialog box
Repairing syntax errors
syntax
Repairing syntax errors
whitespace
Repairing syntax errors
compiler
Repairing syntax errors
attributes
Repairing syntax errors
Machine language
Repairing syntax errors
Java virtual machine (JVM)
Repairing syntax errors
debugging
Repairing syntax errors
javadoc
Repairing syntax errors
encapsulation
Repairing syntax errors
inheritance
Repairing syntax errors
polymorphism
Repairing syntax errors
method
Question
What is the purpose of the argument "null" in the statement below: JOptionPane.showMessageDialog(null, "Show my message");

A) This argument is ignored by Java.
B) The output message will be placed in the upper left corner of the screen.
C) The output message will be placed in the middle of the screen.
D) It instructs Java to display the message immediately.
Question
Match between columns
Allow you to assign intuitive names to areas of computer memory
literal string
Allow you to assign intuitive names to areas of computer memory
high-level programming languages
Allow you to assign intuitive names to areas of computer memory
dialog box
Allow you to assign intuitive names to areas of computer memory
syntax
Allow you to assign intuitive names to areas of computer memory
whitespace
Allow you to assign intuitive names to areas of computer memory
compiler
Allow you to assign intuitive names to areas of computer memory
attributes
Allow you to assign intuitive names to areas of computer memory
Machine language
Allow you to assign intuitive names to areas of computer memory
Java virtual machine (JVM)
Allow you to assign intuitive names to areas of computer memory
debugging
Allow you to assign intuitive names to areas of computer memory
javadoc
Allow you to assign intuitive names to areas of computer memory
encapsulation
Allow you to assign intuitive names to areas of computer memory
inheritance
Allow you to assign intuitive names to areas of computer memory
polymorphism
Allow you to assign intuitive names to areas of computer memory
method
Question
Regarding code layout, write the following Java code using a common alternate placement of the first curly brace:
public static void main(String[] args)
{
System.out.println("First Java application");
}
Question
Once an application is written and saved, the Java class must be compiled. Describe what two procedures must occur in order to view the output of the application.
Question
Why is creating a GUI environment for users a natural use for object orientation?
Question
Explain the purpose of arguments and why it is necessary to pass arguments to a method.
Question
When you define a Java class using an identifier, what are the requirements you need to know?
Question
public class FindMyErrors
{
   public static void main(String[] args)
   {
       System.out.println("My application with errors)
    }
Given the above code, identify three separate syntax errors.
Question
If you modify a class, what are the steps you must take to see your changes in the executing program?
Question
What happens after a programmer successfully compiles a Java program named "First.java"?
Question
What are the differences between K & R style and Allman style? Which one is used in this textbook?
Question
What are some of the reasons the javac command might not be recognized?
Question
Write a line comment and block comment for the following line of code identifying the author, date, and purpose of the method. In addition, explain the difference between comments that consist of a double-slash (//) and those that have a starting and ending slash asterisk (/* .. */).
System.out.println("Hello Students");
Question
Describe the components (objects and classes) that are used in the statement System.out.println() .
Question
Briefly describe the elements of the main() method:
public static void main(String[] args)
{
Java code...
}
Question
Provide examples of logic errors. How do programmers minimize logic errors in their code?
Question
System.out.println("First Java application");
​ Given the above code, identify and describe the use of a literal string and the use of parentheses.
Question
Why is it important for programmers to use program comments?
Unlock Deck
Sign up to unlock the cards in this deck!
Unlock Deck
Unlock Deck
1/76
auto play flashcards
Play
simple tutorial
Full screen (f)
exit full mode
Deck 1: Creating Your First Java Classes
1
Given the statement:   System.out.println("First Java application"); out refers to ____.

A) the screen
B) the standard output device
C) the printer
D) the keyboard
B
2
Locating and repairing all syntax errors is part of the process of ____ a program.

A) interpreting
B) compiling
C) debugging
D) executing
C
3
____ are pieces of information that are sent into, or passed to, a method, usually because the method requires the information to perform its task or carry out its purpose.

A) Applets
B) Methods
C) Arguments
D) Objects
C
4
In Java, the reserved keyword ____ means that a method is accessible and usable even though no objects of the class exist.

A) active
B) undefined
C) static
D) void
Unlock Deck
Unlock for access to all 76 flashcards in this deck.
Unlock Deck
k this deck
5
When you issue the command to compile a class containing errors, the Java compiler does not produce any error messages. You will first need to run the class in order to see error messages.
Unlock Deck
Unlock for access to all 76 flashcards in this deck.
Unlock Deck
k this deck
6
A Java identifier can contain only letters, digits, ampersands, or number signs.
Unlock Deck
Unlock for access to all 76 flashcards in this deck.
Unlock Deck
k this deck
7
Dots (or periods) in a Java statement are used to separate the names of the components that make up the statement.
Unlock Deck
Unlock for access to all 76 flashcards in this deck.
Unlock Deck
k this deck
8
If an object's methods are well written, the user is unaware of the low-level details of how the methods are executed, and the user must simply understand the interface or interaction between the method and the object.
Unlock Deck
Unlock for access to all 76 flashcards in this deck.
Unlock Deck
k this deck
9
System software is used for tasks such as word processing, calculations and playing games.
Unlock Deck
Unlock for access to all 76 flashcards in this deck.
Unlock Deck
k this deck
10
A(n) ____ defines the circumstances under which a class can be accessed and the other classes that have the right to use a class.

A) identifier
B) access specifier
C) parameter
D) Pascal casing
Unlock Deck
Unlock for access to all 76 flashcards in this deck.
Unlock Deck
k this deck
11
Using the void keyword in the main() method header indicates that a value will be returned by the main() method is called.
Unlock Deck
Unlock for access to all 76 flashcards in this deck.
Unlock Deck
k this deck
12
A compiler ignores whitespace (that is, any combination of nonprinting characters) between words and lines.
Unlock Deck
Unlock for access to all 76 flashcards in this deck.
Unlock Deck
k this deck
13
Although not a requirement, it is Java standard that class identifiers begin with an uppercase letter and use other uppercase letters to improve readability.
Unlock Deck
Unlock for access to all 76 flashcards in this deck.
Unlock Deck
k this deck
14
____ describes the feature of languages that allows the same word to be interpreted correctly in different situations based on the context.

A) Polymorphism
B) Architecturally neutral
C) Source code
D) Insulation
Unlock Deck
Unlock for access to all 76 flashcards in this deck.
Unlock Deck
k this deck
15
You must use the Java interpreter to translate the bytecode into executable statements before running a Java application.
Unlock Deck
Unlock for access to all 76 flashcards in this deck.
Unlock Deck
k this deck
16
____ refers to the hiding of data and methods within an object.

A) Instance
B) Inheritance
C) Passed
D) Encapsulation
Unlock Deck
Unlock for access to all 76 flashcards in this deck.
Unlock Deck
k this deck
17
A program written in ____ is the most basic circuitry-level language.

A) Java
B) machine language
C) BASIC
D) C
Unlock Deck
Unlock for access to all 76 flashcards in this deck.
Unlock Deck
k this deck
18
Logic errors are easily identified when a program is compiled.
Unlock Deck
Unlock for access to all 76 flashcards in this deck.
Unlock Deck
k this deck
19
Line comments start with ____.

A) a forward slash and an asterisk
B) two forward slashes
C) a forward slash and two asterisks
D) a percent sign
Unlock Deck
Unlock for access to all 76 flashcards in this deck.
Unlock Deck
k this deck
20
____ are also called modules, methods, functions, and subroutines. Java programmers most frequently use the term "method."

A) Procedures
B) Calls
C) Classes
D) Applications
Unlock Deck
Unlock for access to all 76 flashcards in this deck.
Unlock Deck
k this deck
21
After a successful compile, you can run the class file on any computer that has a ____.

A) Java language interpreter
B) Web browser
C) text editor
D) DOS
Unlock Deck
Unlock for access to all 76 flashcards in this deck.
Unlock Deck
k this deck
22
You use an  import  statement when you want to access a built-in Java class that is contained in a group of classes called a(n) ____.

A) JGroup
B) JImport
C) package
D) GUI
Unlock Deck
Unlock for access to all 76 flashcards in this deck.
Unlock Deck
k this deck
23
A ____ is an error not detected until the program asks the computer to do something wrong, or even illegal, while executing.

A) syntax error
B) run-time error
C) package
D) Java API
Unlock Deck
Unlock for access to all 76 flashcards in this deck.
Unlock Deck
k this deck
24
In programming, named computer memory locations are called ____because they hold values that might vary.

A) constants
B) variables
C) strings
D) addresses
Unlock Deck
Unlock for access to all 76 flashcards in this deck.
Unlock Deck
k this deck
25
Whenever a method requires multiple arguments, the arguments are always separated with ____.

A) commas
B) periods
C) forward slashes
D) brackets
Unlock Deck
Unlock for access to all 76 flashcards in this deck.
Unlock Deck
k this deck
26
In a ____ environment, you can change directories using the cd command. For example, to change to a directory named MyClasses , you type cd MyClasses and press Enter.

A) Windows
B) Java
C) graphical
D) DOS
Unlock Deck
Unlock for access to all 76 flashcards in this deck.
Unlock Deck
k this deck
27
   public class First    {
     public static void main(String[] args)
     {
        System.out.println("First Java application");
     }
   }
Given the above code, which item identifies the method's return type?

A) public
B) static
C) void
D) println
Unlock Deck
Unlock for access to all 76 flashcards in this deck.
Unlock Deck
k this deck
28
____ is the process the compiler uses to divide your source code into meaningful portions; the message means that the compiler was in the process of analyzing the code when the end of the file was encountered prematurely.

A) Running
B) Debugging
C) Compiling
D) Parsing
Unlock Deck
Unlock for access to all 76 flashcards in this deck.
Unlock Deck
k this deck
29
If you receive an error that states, "Exception in thread 'main' java.lang.NoClassDefFoundError," when you try to execute the application, you probably do not have your ____ set correctly.

A) class length
B) class path
C) java
D) object
Unlock Deck
Unlock for access to all 76 flashcards in this deck.
Unlock Deck
k this deck
30
Java contains a class named ____ that allows you to produce dialog boxes.

A) JBox
B) JOptionPane
C) JDialog
D) JGUI
Unlock Deck
Unlock for access to all 76 flashcards in this deck.
Unlock Deck
k this deck
31
public class First {
   public static void main(String[] args)
   {
      System.out.println("First Java application");
   }
}
Given the above code, which item identifies the name of the class?

A) public
B) static
C) void
D) First
Unlock Deck
Unlock for access to all 76 flashcards in this deck.
Unlock Deck
k this deck
32
   public class First    {
     public static void main(String[] args)
     {
        System.out.println("First Java application");
     }
   }
Given the above code, which item identifies that the method will work without instantiating an object of the class?

A) public
B) static
C) void
D) println
Unlock Deck
Unlock for access to all 76 flashcards in this deck.
Unlock Deck
k this deck
33
A(n) ____ error occurs when the syntax of the program is correct and the program compiles but produces incorrect results when you execute it.

A) logic
B) syntax
C) JVM
D) class
Unlock Deck
Unlock for access to all 76 flashcards in this deck.
Unlock Deck
k this deck
34
____ comments are a special case of block comments that are used to generate documentation.

A) Line comments
B) Doc comments
C) JDoc
D) Javadoc
Unlock Deck
Unlock for access to all 76 flashcards in this deck.
Unlock Deck
k this deck
35
It is a tradition among programmers that the first program you write in any language produces "____" as its output.

A) Hi, your name!
B) Hello, world!
C) My first program!
D) Hello, your name!
Unlock Deck
Unlock for access to all 76 flashcards in this deck.
Unlock Deck
k this deck
36
{ public static void main(String[] args)
   {
      System.out.println("First Java application");
   }
}
Given the above code, which item identifies the access specifier?

A) public
B) static
C) void
D) First
Unlock Deck
Unlock for access to all 76 flashcards in this deck.
Unlock Deck
k this deck
37
If a compiler detects a violation of language rules, it refuses to translate the class to ____.

A) an application
B) a logic error
C) machine code
D) Java
Unlock Deck
Unlock for access to all 76 flashcards in this deck.
Unlock Deck
k this deck
38
When you run a Java application using the ____ command, do not add the .class extension to the filename.

A) class
B) static
C) java
D) output
Unlock Deck
Unlock for access to all 76 flashcards in this deck.
Unlock Deck
k this deck
39
It is best to use the ____ available text editor when writing Java programs.

A) most complex
B) simplest
C) best
D) latest
Unlock Deck
Unlock for access to all 76 flashcards in this deck.
Unlock Deck
k this deck
40
The ____ is also called the Java class library; it contains information about how to use every prewritten Java class, including lists of all the methods you can use with the classes.

A) Java package
B) Java Interface
C) Java SDK
D) Java API
Unlock Deck
Unlock for access to all 76 flashcards in this deck.
Unlock Deck
k this deck
41
Match between columns
The characteristics that define an object
literal string
The characteristics that define an object
high-level programming languages
The characteristics that define an object
dialog box
The characteristics that define an object
syntax
The characteristics that define an object
whitespace
The characteristics that define an object
compiler
The characteristics that define an object
attributes
The characteristics that define an object
Machine language
The characteristics that define an object
Java virtual machine (JVM)
The characteristics that define an object
debugging
The characteristics that define an object
javadoc
The characteristics that define an object
encapsulation
The characteristics that define an object
inheritance
The characteristics that define an object
polymorphism
The characteristics that define an object
method
Unlock Deck
Unlock for access to all 76 flashcards in this deck.
Unlock Deck
k this deck
42
Match between columns
Any combination of nonprinting characters
literal string
Any combination of nonprinting characters
high-level programming languages
Any combination of nonprinting characters
dialog box
Any combination of nonprinting characters
syntax
Any combination of nonprinting characters
whitespace
Any combination of nonprinting characters
compiler
Any combination of nonprinting characters
attributes
Any combination of nonprinting characters
Machine language
Any combination of nonprinting characters
Java virtual machine (JVM)
Any combination of nonprinting characters
debugging
Any combination of nonprinting characters
javadoc
Any combination of nonprinting characters
encapsulation
Any combination of nonprinting characters
inheritance
Any combination of nonprinting characters
polymorphism
Any combination of nonprinting characters
method
Unlock Deck
Unlock for access to all 76 flashcards in this deck.
Unlock Deck
k this deck
43
Match between columns
Creating classes that share from existing classes
literal string
Creating classes that share from existing classes
high-level programming languages
Creating classes that share from existing classes
dialog box
Creating classes that share from existing classes
syntax
Creating classes that share from existing classes
whitespace
Creating classes that share from existing classes
compiler
Creating classes that share from existing classes
attributes
Creating classes that share from existing classes
Machine language
Creating classes that share from existing classes
Java virtual machine (JVM)
Creating classes that share from existing classes
debugging
Creating classes that share from existing classes
javadoc
Creating classes that share from existing classes
encapsulation
Creating classes that share from existing classes
inheritance
Creating classes that share from existing classes
polymorphism
Creating classes that share from existing classes
method
Unlock Deck
Unlock for access to all 76 flashcards in this deck.
Unlock Deck
k this deck
44
Match between columns
Hypothetical computer used to run a Java program
literal string
Hypothetical computer used to run a Java program
high-level programming languages
Hypothetical computer used to run a Java program
dialog box
Hypothetical computer used to run a Java program
syntax
Hypothetical computer used to run a Java program
whitespace
Hypothetical computer used to run a Java program
compiler
Hypothetical computer used to run a Java program
attributes
Hypothetical computer used to run a Java program
Machine language
Hypothetical computer used to run a Java program
Java virtual machine (JVM)
Hypothetical computer used to run a Java program
debugging
Hypothetical computer used to run a Java program
javadoc
Hypothetical computer used to run a Java program
encapsulation
Hypothetical computer used to run a Java program
inheritance
Hypothetical computer used to run a Java program
polymorphism
Hypothetical computer used to run a Java program
method
Unlock Deck
Unlock for access to all 76 flashcards in this deck.
Unlock Deck
k this deck
45
Match between columns
Translates an entire program before carrying out the statement
literal string
Translates an entire program before carrying out the statement
high-level programming languages
Translates an entire program before carrying out the statement
dialog box
Translates an entire program before carrying out the statement
syntax
Translates an entire program before carrying out the statement
whitespace
Translates an entire program before carrying out the statement
compiler
Translates an entire program before carrying out the statement
attributes
Translates an entire program before carrying out the statement
Machine language
Translates an entire program before carrying out the statement
Java virtual machine (JVM)
Translates an entire program before carrying out the statement
debugging
Translates an entire program before carrying out the statement
javadoc
Translates an entire program before carrying out the statement
encapsulation
Translates an entire program before carrying out the statement
inheritance
Translates an entire program before carrying out the statement
polymorphism
Translates an entire program before carrying out the statement
method
Unlock Deck
Unlock for access to all 76 flashcards in this deck.
Unlock Deck
k this deck
46
Match between columns
The rules for the programming language
literal string
The rules for the programming language
high-level programming languages
The rules for the programming language
dialog box
The rules for the programming language
syntax
The rules for the programming language
whitespace
The rules for the programming language
compiler
The rules for the programming language
attributes
The rules for the programming language
Machine language
The rules for the programming language
Java virtual machine (JVM)
The rules for the programming language
debugging
The rules for the programming language
javadoc
The rules for the programming language
encapsulation
The rules for the programming language
inheritance
The rules for the programming language
polymorphism
The rules for the programming language
method
Unlock Deck
Unlock for access to all 76 flashcards in this deck.
Unlock Deck
k this deck
47
Match between columns
A GUI object resembling a window in which you can place messages you want to display
literal string
A GUI object resembling a window in which you can place messages you want to display
high-level programming languages
A GUI object resembling a window in which you can place messages you want to display
dialog box
A GUI object resembling a window in which you can place messages you want to display
syntax
A GUI object resembling a window in which you can place messages you want to display
whitespace
A GUI object resembling a window in which you can place messages you want to display
compiler
A GUI object resembling a window in which you can place messages you want to display
attributes
A GUI object resembling a window in which you can place messages you want to display
Machine language
A GUI object resembling a window in which you can place messages you want to display
Java virtual machine (JVM)
A GUI object resembling a window in which you can place messages you want to display
debugging
A GUI object resembling a window in which you can place messages you want to display
javadoc
A GUI object resembling a window in which you can place messages you want to display
encapsulation
A GUI object resembling a window in which you can place messages you want to display
inheritance
A GUI object resembling a window in which you can place messages you want to display
polymorphism
A GUI object resembling a window in which you can place messages you want to display
method
Unlock Deck
Unlock for access to all 76 flashcards in this deck.
Unlock Deck
k this deck
48
A class named  first  is different from a class named  FIRST because ____.

A) Java is case insensitive
B) it is confusing to have two names that look the same
C) Java is case sensitive
D) first and FIRST are different literal strings
Unlock Deck
Unlock for access to all 76 flashcards in this deck.
Unlock Deck
k this deck
49
Match between columns
The same word can be used in different situations
literal string
The same word can be used in different situations
high-level programming languages
The same word can be used in different situations
dialog box
The same word can be used in different situations
syntax
The same word can be used in different situations
whitespace
The same word can be used in different situations
compiler
The same word can be used in different situations
attributes
The same word can be used in different situations
Machine language
The same word can be used in different situations
Java virtual machine (JVM)
The same word can be used in different situations
debugging
The same word can be used in different situations
javadoc
The same word can be used in different situations
encapsulation
The same word can be used in different situations
inheritance
The same word can be used in different situations
polymorphism
The same word can be used in different situations
method
Unlock Deck
Unlock for access to all 76 flashcards in this deck.
Unlock Deck
k this deck
50
Match between columns
Series of characters that will appear in output exactly as entered
literal string
Series of characters that will appear in output exactly as entered
high-level programming languages
Series of characters that will appear in output exactly as entered
dialog box
Series of characters that will appear in output exactly as entered
syntax
Series of characters that will appear in output exactly as entered
whitespace
Series of characters that will appear in output exactly as entered
compiler
Series of characters that will appear in output exactly as entered
attributes
Series of characters that will appear in output exactly as entered
Machine language
Series of characters that will appear in output exactly as entered
Java virtual machine (JVM)
Series of characters that will appear in output exactly as entered
debugging
Series of characters that will appear in output exactly as entered
javadoc
Series of characters that will appear in output exactly as entered
encapsulation
Series of characters that will appear in output exactly as entered
inheritance
Series of characters that will appear in output exactly as entered
polymorphism
Series of characters that will appear in output exactly as entered
method
Unlock Deck
Unlock for access to all 76 flashcards in this deck.
Unlock Deck
k this deck
51
A(n) ____ is a GUI object resembling a window in which you can place messages you want to display.

A) JDK
B) dialog box
C) variable
D) argument
Unlock Deck
Unlock for access to all 76 flashcards in this deck.
Unlock Deck
k this deck
52
Match between columns
Placing data and methods within an object
literal string
Placing data and methods within an object
high-level programming languages
Placing data and methods within an object
dialog box
Placing data and methods within an object
syntax
Placing data and methods within an object
whitespace
Placing data and methods within an object
compiler
Placing data and methods within an object
attributes
Placing data and methods within an object
Machine language
Placing data and methods within an object
Java virtual machine (JVM)
Placing data and methods within an object
debugging
Placing data and methods within an object
javadoc
Placing data and methods within an object
encapsulation
Placing data and methods within an object
inheritance
Placing data and methods within an object
polymorphism
Placing data and methods within an object
method
Unlock Deck
Unlock for access to all 76 flashcards in this deck.
Unlock Deck
k this deck
53
Using the given code, which statement in the  main()  method body will produce the output "Hello to all!". public class Hello
{
   public static void main(String[] args)
   {
       ____
   }
{

A) System.out("Hello to all!");
B) System.println("Hello to all!");
C) println("Hello to all!");
D) System.out.println("Hello to all!");
Unlock Deck
Unlock for access to all 76 flashcards in this deck.
Unlock Deck
k this deck
54
Programmers use ____ to organize program code and make it easier to read.

A) literal strings
B) whitespace
C) headings
D) FAQs
Unlock Deck
Unlock for access to all 76 flashcards in this deck.
Unlock Deck
k this deck
55
Match between columns
Self-contained block of code that carries out an action
literal string
Self-contained block of code that carries out an action
high-level programming languages
Self-contained block of code that carries out an action
dialog box
Self-contained block of code that carries out an action
syntax
Self-contained block of code that carries out an action
whitespace
Self-contained block of code that carries out an action
compiler
Self-contained block of code that carries out an action
attributes
Self-contained block of code that carries out an action
Machine language
Self-contained block of code that carries out an action
Java virtual machine (JVM)
Self-contained block of code that carries out an action
debugging
Self-contained block of code that carries out an action
javadoc
Self-contained block of code that carries out an action
encapsulation
Self-contained block of code that carries out an action
inheritance
Self-contained block of code that carries out an action
polymorphism
Self-contained block of code that carries out an action
method
Unlock Deck
Unlock for access to all 76 flashcards in this deck.
Unlock Deck
k this deck
56
Match between columns
A low-level programming language
literal string
A low-level programming language
high-level programming languages
A low-level programming language
dialog box
A low-level programming language
syntax
A low-level programming language
whitespace
A low-level programming language
compiler
A low-level programming language
attributes
A low-level programming language
Machine language
A low-level programming language
Java virtual machine (JVM)
A low-level programming language
debugging
A low-level programming language
javadoc
A low-level programming language
encapsulation
A low-level programming language
inheritance
A low-level programming language
polymorphism
A low-level programming language
method
Unlock Deck
Unlock for access to all 76 flashcards in this deck.
Unlock Deck
k this deck
57
Match between columns
Documentation comments
literal string
Documentation comments
high-level programming languages
Documentation comments
dialog box
Documentation comments
syntax
Documentation comments
whitespace
Documentation comments
compiler
Documentation comments
attributes
Documentation comments
Machine language
Documentation comments
Java virtual machine (JVM)
Documentation comments
debugging
Documentation comments
javadoc
Documentation comments
encapsulation
Documentation comments
inheritance
Documentation comments
polymorphism
Documentation comments
method
Unlock Deck
Unlock for access to all 76 flashcards in this deck.
Unlock Deck
k this deck
58
Match between columns
Repairing syntax errors
literal string
Repairing syntax errors
high-level programming languages
Repairing syntax errors
dialog box
Repairing syntax errors
syntax
Repairing syntax errors
whitespace
Repairing syntax errors
compiler
Repairing syntax errors
attributes
Repairing syntax errors
Machine language
Repairing syntax errors
Java virtual machine (JVM)
Repairing syntax errors
debugging
Repairing syntax errors
javadoc
Repairing syntax errors
encapsulation
Repairing syntax errors
inheritance
Repairing syntax errors
polymorphism
Repairing syntax errors
method
Unlock Deck
Unlock for access to all 76 flashcards in this deck.
Unlock Deck
k this deck
59
What is the purpose of the argument "null" in the statement below: JOptionPane.showMessageDialog(null, "Show my message");

A) This argument is ignored by Java.
B) The output message will be placed in the upper left corner of the screen.
C) The output message will be placed in the middle of the screen.
D) It instructs Java to display the message immediately.
Unlock Deck
Unlock for access to all 76 flashcards in this deck.
Unlock Deck
k this deck
60
Match between columns
Allow you to assign intuitive names to areas of computer memory
literal string
Allow you to assign intuitive names to areas of computer memory
high-level programming languages
Allow you to assign intuitive names to areas of computer memory
dialog box
Allow you to assign intuitive names to areas of computer memory
syntax
Allow you to assign intuitive names to areas of computer memory
whitespace
Allow you to assign intuitive names to areas of computer memory
compiler
Allow you to assign intuitive names to areas of computer memory
attributes
Allow you to assign intuitive names to areas of computer memory
Machine language
Allow you to assign intuitive names to areas of computer memory
Java virtual machine (JVM)
Allow you to assign intuitive names to areas of computer memory
debugging
Allow you to assign intuitive names to areas of computer memory
javadoc
Allow you to assign intuitive names to areas of computer memory
encapsulation
Allow you to assign intuitive names to areas of computer memory
inheritance
Allow you to assign intuitive names to areas of computer memory
polymorphism
Allow you to assign intuitive names to areas of computer memory
method
Unlock Deck
Unlock for access to all 76 flashcards in this deck.
Unlock Deck
k this deck
61
Regarding code layout, write the following Java code using a common alternate placement of the first curly brace:
public static void main(String[] args)
{
System.out.println("First Java application");
}
Unlock Deck
Unlock for access to all 76 flashcards in this deck.
Unlock Deck
k this deck
62
Once an application is written and saved, the Java class must be compiled. Describe what two procedures must occur in order to view the output of the application.
Unlock Deck
Unlock for access to all 76 flashcards in this deck.
Unlock Deck
k this deck
63
Why is creating a GUI environment for users a natural use for object orientation?
Unlock Deck
Unlock for access to all 76 flashcards in this deck.
Unlock Deck
k this deck
64
Explain the purpose of arguments and why it is necessary to pass arguments to a method.
Unlock Deck
Unlock for access to all 76 flashcards in this deck.
Unlock Deck
k this deck
65
When you define a Java class using an identifier, what are the requirements you need to know?
Unlock Deck
Unlock for access to all 76 flashcards in this deck.
Unlock Deck
k this deck
66
public class FindMyErrors
{
   public static void main(String[] args)
   {
       System.out.println("My application with errors)
    }
Given the above code, identify three separate syntax errors.
Unlock Deck
Unlock for access to all 76 flashcards in this deck.
Unlock Deck
k this deck
67
If you modify a class, what are the steps you must take to see your changes in the executing program?
Unlock Deck
Unlock for access to all 76 flashcards in this deck.
Unlock Deck
k this deck
68
What happens after a programmer successfully compiles a Java program named "First.java"?
Unlock Deck
Unlock for access to all 76 flashcards in this deck.
Unlock Deck
k this deck
69
What are the differences between K & R style and Allman style? Which one is used in this textbook?
Unlock Deck
Unlock for access to all 76 flashcards in this deck.
Unlock Deck
k this deck
70
What are some of the reasons the javac command might not be recognized?
Unlock Deck
Unlock for access to all 76 flashcards in this deck.
Unlock Deck
k this deck
71
Write a line comment and block comment for the following line of code identifying the author, date, and purpose of the method. In addition, explain the difference between comments that consist of a double-slash (//) and those that have a starting and ending slash asterisk (/* .. */).
System.out.println("Hello Students");
Unlock Deck
Unlock for access to all 76 flashcards in this deck.
Unlock Deck
k this deck
72
Describe the components (objects and classes) that are used in the statement System.out.println() .
Unlock Deck
Unlock for access to all 76 flashcards in this deck.
Unlock Deck
k this deck
73
Briefly describe the elements of the main() method:
public static void main(String[] args)
{
Java code...
}
Unlock Deck
Unlock for access to all 76 flashcards in this deck.
Unlock Deck
k this deck
74
Provide examples of logic errors. How do programmers minimize logic errors in their code?
Unlock Deck
Unlock for access to all 76 flashcards in this deck.
Unlock Deck
k this deck
75
System.out.println("First Java application");
​ Given the above code, identify and describe the use of a literal string and the use of parentheses.
Unlock Deck
Unlock for access to all 76 flashcards in this deck.
Unlock Deck
k this deck
76
Why is it important for programmers to use program comments?
Unlock Deck
Unlock for access to all 76 flashcards in this deck.
Unlock Deck
k this deck
locked card icon
Unlock Deck
Unlock for access to all 76 flashcards in this deck.