Chapter 1: Creating Your First Java Classes
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.
Java Interface
A class named first is different from a class named FIRST because ____.
Java is case sensitive
After a successful compile, you can run the class file on any computer that has a ____.
Java language interpreter
Hypothetical computer used to run a Java program
Java virtual machine (JVM)
A low-level programming language
Machine language
____ 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.
Parsing
describes the feature of languages that allows the same word to be interpreted correctly in different situations based on the context.
Polymorphism
____ are also called modules, methods, functions, and subroutines. Java programmers most frequently use the term "method."
Procedures
Although not a requirement, it is Java standard that class identifiers begin with an uppercase letter and use other uppercase letters to improve readability.
True
Dots (or periods) in a Java statement are used to separate the names of the components that make up the statement.
True
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.
True
Allow you to assign intuitive names to areas of computer memory
high-level programming languages
Creating classes that share from existing classes
inheritance
When you run a Java application using the ____ command, do not add the .class extension to the filename.
java
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.
Arguments
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.
DOS
____ comments are a special case of block comments that are used to generate documentation.
Doc comments
____ refers to the hiding of data and methods within an object.
Encapsulation
A Java identifier can contain only letters, digits, ampersands, or number signs.
False
Logic errors are easily identified when a program is compiled.
False
System software is used for tasks such as word processing, calculations and playing games.
False
Using the void keyword in the main() method header indicates that a value will be returned by the main() method is called.
False
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.
False
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?
First
It is a tradition among programmers that the first program you write in any language produces "____" as its output.
Hello, world!
Java contains a class named ____ that allows you to produce dialog boxes.
JOptionPane
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) { ____ } {
System.out.println("Hello to all!");
What is the purpose of the argument "null" in the statement below: JOptionPane.showMessageDialog(null, "Show my message");
The output message will be placed in the middle of the screen.
A compiler ignores whitespace (that is, any combination of nonprinting characters) between words and lines.
True
You must use the Java interpreter to translate the bytecode into executable statements before running a Java application.
True
A(n) ____ defines the circumstances under which a class can be accessed and the other classes that have the right to use a class.
access specifier
The characteristics that define an object
attributes
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.
class path
Whenever a method requires multiple arguments, the arguments are always separated with ____.
commas
Translates an entire program before carrying out the statement
compiler
Locating and repairing all syntax errors is part of the process of ____ a program.
debugging
Repairing syntax errors
debugging
A(n) ____ is a GUI object resembling a window in which you can place messages you want to display.
dialog box
Series of characters that will appear in output exactly as entered
encapsulation
Documentation comments
javadoc
The same word can be used in different situations
literal string
A(n) ____ error occurs when the syntax of the program is correct and the program compiles but produces incorrect results when you execute it.
logic
If a compiler detects a violation of language rules, it refuses to translate the class to ____.
machine code
A program written in ____ is the most basic circuitry-level language.
machine language
Self-contained block of code that carries out an action
method
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) ____.
package
A GUI object resembling a window in which you can place messages you want to display
polymorphism
{ public static void main(String[] args) { System.out.println("First Java application"); } } Given the above code, which item identifies the access specifier?
public
A ____ is an error not detected until the program asks the computer to do something wrong, or even illegal, while executing.
run-time error
It is best to use the ____ available text editor when writing Java programs.
simplest
In Java, the reserved keyword ____ means that a method is accessible and usable even though no objects of the class exist.
static
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?
static
The rules for the programming language
syntax
Given the statement: System.out.println("First Java application"); out refers to ____.
the standard output device
Line comments start with ____.
two forward slashes
In programming, named computer memory locations are called ____because they hold values that might vary.
variables
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?
void
Any combination of nonprinting characters
whitespace
Programmers use ____ to organize program code and make it easier to read.
whitespace