Deck 1: Introduction

Full screen (f)
exit full mode
Question
Which statement best describes a computer program?

A) A program is a sequence of comments.
B) A program can decide what task it is to perform.
C) A program is a sequence of instructions and decisions that the computer carries out.
D) A program can only perform one simple task.
Use Space or
up arrow
down arrow
to flip the card.
Question
What translates Java source code into files that contain instructions for the JVM?

A) linker
B) compiler
C) assembler
D) interpreter
Question
Which statement is true about running a Java program on a different CPU?

A) You need different Java source code for each processor.
B) You can take code that has been generated by the Java compiler and run it on different CPUs.
C) You need to recompile the Java program for each processor.
D) You cannot run the program on a computer with a different processor because Java, being a high-level programming language, is machine dependent.
Question
Which of the following is not contained on the motherboard of a computer?

A) RAM
B) integrated circuit
C) hard disk
D) CPU
Question
Which one of the following is NOT a function of a CPU?

A) Performing arithmetic operations
B) Processing data and controlling programs
C) Querying a database
D) Fetching and storing data from storage and input devices
Question
What does CPU stand for?

A) Computer Programming Unit
B) Computer Processing Unit
C) Central Processing Unit
D) Central Programming Unit
Question
What are the electrical lines called that interconnect the CPU, RAM, and the electronics controlling the hard disk and other devices?

A) bus
B) network
C) optical disk
D) power lines
Question
Which part of a computer contains the CPU, the RAM, and connectors to peripheral devices?

A) network
B) bus
C) motherboard
D) optical disk
Question
Which one of the following memory types provides storage that persists without electricity?

A) primary storage
B) RAM
C) memory
D) secondary storage
Question
What is the JVM?

A) A vital machine that never fails to run compiled Java code.
B) A vital machine that compiles Java code into machine instructions.
C) A virtual machine that runs compiled Java code on any CPU.
D) A virtual machine that compiles Java code into machine instructions.
Question
When was Java officially introduced?

A) 1989
B) 1995
C) 2005
D) 2000
Question
Which type of secondary storage consists of rotating platters, which are coated with a magnetic material, and read/write heads, which can detect and change the patterns of varying magnetic flux on the platters?

A) hard disk
B) flashdrive
C) DVD
D) RAM
Question
What term is used to refer to the computer instructions that are executed by a CPU, which are specific to each CPU?

A) virtual machine
B) machine code
C) high-level code
D) instruction set
Question
What term is used to refer to languages that allow programmers to describe tasks at a higher conceptual level than machine code?

A) virtual
B) high-level
C) sophisticated
D) conceptual
Question
For a program to be executed, where must it reside so that the CPU can read its instructions?

A) optical disk
B) primary memory
C) secondary memory
D) hard disk
Question
What translates high-level descriptions into machine code?

A) debugger
B) assembler
C) compiler
D) linker
Question
Which statement regarding computer programs is correct?

A) Computer programs can decide what task to perform.
B) Large and complex computer programs are generally written by only one programmer.
C) Computer programs are composed of extremely primitive operations.
D) Small computer programs are not documented.
Question
Which memory type does not provide persistent storage?

A) secondary storage
B) hard disk
C) primary storage
D) DVD
Question
Which type of storage is made from memory chips?

A) CD
B) hard disk
C) primary storage
D) DVD
Question
What is the term used to refer to Java code that runs in a browser?

A) applet
B) script
C) html
D) class
Question
A method may be called by specifying which 3 items in the specified order?

A) method name, parameters, object
B) object, parameters, method name
C) object, method name, parameters
D) class, parameters, method name
Question
In a console window, assuming that MyClass includes the main method, how do you run the program?

A) java MyClass.class
B) javac MyClass
C) java MyClass
D) javac MyClass.java
Question
What term is used to refer to text in a program that helps human readers understand the program?

A) methods
B) comments
C) constants
D) statements
Question
When a Java application starts, what is the name of the method that is executed?

A) main
B) start
C) begin
D) Main
Question
A(n) ____ is a collection of code that has been programmed and translated by someone else, ready for use in your program.

A) method
B) class
C) parameter
D) library
Question
A __________ contains sequences of instructions to perform a particular task.

A) parameter
B) label
C) variable
D) method
Question
What is the name of the file declaring the class named MyClass?

A) MyClass
B) myclass.java
C) MyClass.class
D) MyClass.java
Question
Parameters to methods are enclosed by these symbols.

A) ()
B) ""
C) {}
D) //
Question
What term is used to refer to a sequence of characters enclosed in quotation marks?

A) string
B) object
C) comment
D) variable
Question
In Java, every statement must end with this symbol.

A) )
B) )
C) !
D) ;
Question
What term is used to refer to an instruction in a method?

A) statement
B) constant
C) comment
D) object
Question
In a console window, how do you compile the declaration of the class MyClass?

A) javac MyClass.java
B) javac MyClass
C) java MyClass.java
D) java MyClass
Question
The Java compiler ignores any text between ____.

A) (* and *)
B) /* and */
C) {* and *}
D) // and //
Question
Every Java program consists of one or more of these fundamental building blocks.

A) class
B) CPU
C) applet
D) parameter
Question
A method is called on what entity in the program?

A) constant
B) statement
C) comment
D) object
Question
What entity belongs to a class and is manipulated in a program?

A) constant
B) package
C) object
D) comment
Question
Which statement best describes the portability characteristic of Java?

A) It is easy to copy Java source code from one machine to another.
B) The same Java class files will run on different operating systems without change.
C) It is easy to compile Java source code on different operating systems.
D) It is easy to change a Java program so that it will work on different operating systems.
Question
Text enclosed between this and the end of line is ignored by the compiler.

A) ''
B) //
C) ()
D) ""
Question
What term is used to refer to information passed in to a method on a call?

A) class
B) object
C) parameter
D) comment
Question
What is the name of the file that contains the Java source code for the class BankAccount?

A) BankAccount
B) BankAccount.java
C) BankAccount.class
D) BankAccount.txt
Question
What is the output of the following Java statement? System.out.println("4 + 6");

A) 10
B) 46
C) 4
D) 4 + 6
Question
What is the name of the file created after a successful compilation of MyClass.java?

A) MyClass.java
B) MyClass.class
C) myClass.class
D) MyClass
Question
In a console window, assuming that BankAccountTester includes the main method, how do you run the program?

A) javac BankAccountTester
B) java BankAccountTester.class
C) javac BankAccountTester.java
D) java BankAccountTester
Question
What is the object in the given method call? System.out.println("Welcome");

A) println
B) System.out
C) System.out.println
D) System
Question
What type of program can you use to enter your Java program?

A) compiler
B) editor
C) spreadsheet
D) database
Question
Which statement is true about a Java program?

A) Java forces the programmer to use a particular layout for readability.
B) Java requires that at most one statement appear on one line.
C) The first method that is executed in a Java program is called Main.
D) Java is case sensitive.
Question
What is the name of the method in the given method call? System.out.println("Welcome");

A) "Welcome"
B) System
C) println
D) out
Question
What does a class file contain?

A) Instructions for the specific CPU on the computer.
B) Instructions for the Java Virtual Machine.
C) The JVM instructions for all classes in the Java application.
D) The Java source code for a class.
Question
What is the file extension of a Java class file?

A) )java
B) There is no file extension.
C) )class
D) )txt
Question
What is a Java library?

A) A collection of Java source code that has been programmed and can be reused.
B) A collection of books on Java.
C) A collection of electronic documentation on Java.
D) A collection of code that has been programmed and translated by someone else, ready for you to use in your program.
Question
The Java compiler translates source code into what type of file?

A) document
B) object
C) class
D) text
Question
What is the name of the class declared in the file MyClass.java?

A) MyClass
B) MyClass.class
C) MyClass.java
D) myclass
Question
What is the output of the following Java statement? System.out.println(4 + 6);

A) 4 + 6
B) 4
C) 10
D) 46
Question
In a console window, what is the name of the command used to compile Java source code?

A) javac
B) javadoc
C) compile
D) java
Question
In a console window, how do you compile the declaration of the class BankAccount?

A) java BankAccount
B) javac BankAccount
C) javac BankAccount.java
D) java BankAccount.java
Question
Which of the following statements is true about running a Java program?

A) The Java compiler executes your program.
B) The Java virtual machine loads the instructions for the program that you wrote, starts your program, and loads the necessary library files as they are required.
C) The java compiler signals the JVM to execute the program.
D) The javadoc utility runs the documentation of the program.
Question
What is the parameter in the given method call? System.out.println("Welcome");

A) out
B) println
C) "Welcome"
D) System
Question
Suppose that a computer virus infects your computer and corrupts the files you were going to submit for your current homework assignment. What precaution could have saved you from a disastrously bad grade for this assignment?

A) Defragment the hard drive.
B) Purchase an anti-virus program to remove the virus from your computer.
C) Make regular backups of all your important files.
D) Purchase an extended warranty for your computer.
Question
In a console window, what is the name of the command used to run a Java program?

A) javadoc
B) javac
C) java
D) run
Question
What is the syntax for calling the println method on the object System.out?

A) println("Any message").System.out;
B) System.out("Any message").println;
C) System.out.println("Any message");
D) println(System.out, "Any message");
Question
Assume that the following Java statement is contained in the main method of the class named Welcome: System.out.printLine("Welcome!");
What is the name of the file generated by the Java compiler?

A) Welcome.class
B) Welcome.java
C) No file is generated due to an error.
D) Welcome
Question
Who or what is responsible for inspecting and testing the program to guard against logic errors?

A) JVM
B) programmer
C) end-user
D) compiler
Question
Assume that the following Java statement is contained in the main method of the class named Hello: System.out.printLine("Hello!");
What is the name of the file generated by the Java compiler?

A) Hello.java
B) Hello
C) No file is generated due to an error.
D) Hello.class
Question
Assuming the programmer wishes to output the phrase "Welcome!", which of the following is true about the following Java statement. System.out.Println("Wlcome!");

A) There are no errors.
B) There is a compile-time error.
C) There is a run-time error.
D) There are multiple errors.
Question
What is defensive programming?

A) Writing a program that does not contain run-time errors.
B) Programming in a language that allows programmers to describe tasks at a higher conceptual level than machine code.
C) Structuring programs and development processes in such a way that an error in one part of the program does not trigger a disastrous response.
D) Writing a program that does not contain compile-time errors.
Question
Assuming the programmer wishes to display "Hello!" on the screen, which statement is true about the following Java statement: System.out.printn("Helo!");

A) There is a run-time error.
B) There are no errors.
C) There is a compile-time error.
D) There are multiple errors.
Question
Which statement is true about the following Java statement: System.out.println("Welcome!");

A) There are no errors.
B) There is a run-time error.
C) There are multiple errors.
D) There is a compile-time error.
Question
Structuring programs and development processes in such a way that an error in one part of the program does not trigger a disastrous response is referred to as ____.

A) high-level programming
B) offensive programming
C) defensive programming
D) low-level programming
Question
What is another term used to describe an error detected by the compiler that is a violation of the programming language rules?

A) typo
B) logic error
C) semantic error
D) run-time error
Question
Assuming the programmer wishes to output the phrase "Hello!", which of the following is true about the following Java statement. System.out.println("Welcme!");

A) There are multiple errors.
B) There is a run-time error.
C) There are no errors.
D) There is a compile-time error.
Question
What is another term used to describe an error causing a program to take an action that the programmer did not intend?

A) syntax error
B) logic error
C) mistake
D) compile-time error
Question
Assuming the programmer wishes to display "Hello!" on the screen, which statement is true about the following Java statement: System.out.println("Hello!");

A) There is a run-time error.
B) There are no errors.
C) There is a compile-time error.
D) There are multiple errors.
Question
Which statement is true about the following Java statement: System.out.println("Hello!);

A) There is a run-time error.
B) There are no errors.
C) There is a compile-time error.
D) There are multiple errors.
Question
Which one of the following statements regarding backup strategies for Java files is correct?

A) You should have multiple copies of your source files in different locations.
B) You should regularly print out your work so you can retype it in case of data loss.
C) You should regularly back up the Java virtual machine instructions to prevent loss of valuable work.
D) Your compiler automatically makes backups of your source files.
Question
What are special software tools called that let you trace through a program to find run-time errors?

A) compiler
B) debugger
C) CPU
D) virtual machine
Question
What is the term used to describe an error detected by the compiler that is a violation of the programming language rules?

A) logic error
B) compile-time error
C) run-time error
D) typo
Question
Which statement is true about the following Java statement: System.out.Println("Welcome!");

A) There are multiple errors.
B) There are no errors.
C) There is a run-time error.
D) There is a compile-time error.
Question
What is the term used to describe an error causing a program to take an action that the programmer did not intend?

A) typo
B) run-time error
C) compile-time error
D) syntax error
Question
Which statement is true about the compilation process?

A) The compiler will generate CPU specific instructions even if it detects an error.
B) The compiler will generate Java virtual machine instructions even if it detects an error.
C) The compiler will stop compiling when it finds the first error.
D) The compiler will continue compiling after it finds an error.
Question
Assuming the programmer wishes to display "Hello!" on the screen, which statement is true about the following Java statement: System.out.println("Helo!");

A) There is a run-time error.
B) There are no errors.
C) There is a compile-time error.
D) There are multiple errors.
Unlock Deck
Sign up to unlock the cards in this deck!
Unlock Deck
Unlock Deck
1/98
auto play flashcards
Play
simple tutorial
Full screen (f)
exit full mode
Deck 1: Introduction
1
Which statement best describes a computer program?

A) A program is a sequence of comments.
B) A program can decide what task it is to perform.
C) A program is a sequence of instructions and decisions that the computer carries out.
D) A program can only perform one simple task.
C
2
What translates Java source code into files that contain instructions for the JVM?

A) linker
B) compiler
C) assembler
D) interpreter
B
3
Which statement is true about running a Java program on a different CPU?

A) You need different Java source code for each processor.
B) You can take code that has been generated by the Java compiler and run it on different CPUs.
C) You need to recompile the Java program for each processor.
D) You cannot run the program on a computer with a different processor because Java, being a high-level programming language, is machine dependent.
B
4
Which of the following is not contained on the motherboard of a computer?

A) RAM
B) integrated circuit
C) hard disk
D) CPU
Unlock Deck
Unlock for access to all 98 flashcards in this deck.
Unlock Deck
k this deck
5
Which one of the following is NOT a function of a CPU?

A) Performing arithmetic operations
B) Processing data and controlling programs
C) Querying a database
D) Fetching and storing data from storage and input devices
Unlock Deck
Unlock for access to all 98 flashcards in this deck.
Unlock Deck
k this deck
6
What does CPU stand for?

A) Computer Programming Unit
B) Computer Processing Unit
C) Central Processing Unit
D) Central Programming Unit
Unlock Deck
Unlock for access to all 98 flashcards in this deck.
Unlock Deck
k this deck
7
What are the electrical lines called that interconnect the CPU, RAM, and the electronics controlling the hard disk and other devices?

A) bus
B) network
C) optical disk
D) power lines
Unlock Deck
Unlock for access to all 98 flashcards in this deck.
Unlock Deck
k this deck
8
Which part of a computer contains the CPU, the RAM, and connectors to peripheral devices?

A) network
B) bus
C) motherboard
D) optical disk
Unlock Deck
Unlock for access to all 98 flashcards in this deck.
Unlock Deck
k this deck
9
Which one of the following memory types provides storage that persists without electricity?

A) primary storage
B) RAM
C) memory
D) secondary storage
Unlock Deck
Unlock for access to all 98 flashcards in this deck.
Unlock Deck
k this deck
10
What is the JVM?

A) A vital machine that never fails to run compiled Java code.
B) A vital machine that compiles Java code into machine instructions.
C) A virtual machine that runs compiled Java code on any CPU.
D) A virtual machine that compiles Java code into machine instructions.
Unlock Deck
Unlock for access to all 98 flashcards in this deck.
Unlock Deck
k this deck
11
When was Java officially introduced?

A) 1989
B) 1995
C) 2005
D) 2000
Unlock Deck
Unlock for access to all 98 flashcards in this deck.
Unlock Deck
k this deck
12
Which type of secondary storage consists of rotating platters, which are coated with a magnetic material, and read/write heads, which can detect and change the patterns of varying magnetic flux on the platters?

A) hard disk
B) flashdrive
C) DVD
D) RAM
Unlock Deck
Unlock for access to all 98 flashcards in this deck.
Unlock Deck
k this deck
13
What term is used to refer to the computer instructions that are executed by a CPU, which are specific to each CPU?

A) virtual machine
B) machine code
C) high-level code
D) instruction set
Unlock Deck
Unlock for access to all 98 flashcards in this deck.
Unlock Deck
k this deck
14
What term is used to refer to languages that allow programmers to describe tasks at a higher conceptual level than machine code?

A) virtual
B) high-level
C) sophisticated
D) conceptual
Unlock Deck
Unlock for access to all 98 flashcards in this deck.
Unlock Deck
k this deck
15
For a program to be executed, where must it reside so that the CPU can read its instructions?

A) optical disk
B) primary memory
C) secondary memory
D) hard disk
Unlock Deck
Unlock for access to all 98 flashcards in this deck.
Unlock Deck
k this deck
16
What translates high-level descriptions into machine code?

A) debugger
B) assembler
C) compiler
D) linker
Unlock Deck
Unlock for access to all 98 flashcards in this deck.
Unlock Deck
k this deck
17
Which statement regarding computer programs is correct?

A) Computer programs can decide what task to perform.
B) Large and complex computer programs are generally written by only one programmer.
C) Computer programs are composed of extremely primitive operations.
D) Small computer programs are not documented.
Unlock Deck
Unlock for access to all 98 flashcards in this deck.
Unlock Deck
k this deck
18
Which memory type does not provide persistent storage?

A) secondary storage
B) hard disk
C) primary storage
D) DVD
Unlock Deck
Unlock for access to all 98 flashcards in this deck.
Unlock Deck
k this deck
19
Which type of storage is made from memory chips?

A) CD
B) hard disk
C) primary storage
D) DVD
Unlock Deck
Unlock for access to all 98 flashcards in this deck.
Unlock Deck
k this deck
20
What is the term used to refer to Java code that runs in a browser?

A) applet
B) script
C) html
D) class
Unlock Deck
Unlock for access to all 98 flashcards in this deck.
Unlock Deck
k this deck
21
A method may be called by specifying which 3 items in the specified order?

A) method name, parameters, object
B) object, parameters, method name
C) object, method name, parameters
D) class, parameters, method name
Unlock Deck
Unlock for access to all 98 flashcards in this deck.
Unlock Deck
k this deck
22
In a console window, assuming that MyClass includes the main method, how do you run the program?

A) java MyClass.class
B) javac MyClass
C) java MyClass
D) javac MyClass.java
Unlock Deck
Unlock for access to all 98 flashcards in this deck.
Unlock Deck
k this deck
23
What term is used to refer to text in a program that helps human readers understand the program?

A) methods
B) comments
C) constants
D) statements
Unlock Deck
Unlock for access to all 98 flashcards in this deck.
Unlock Deck
k this deck
24
When a Java application starts, what is the name of the method that is executed?

A) main
B) start
C) begin
D) Main
Unlock Deck
Unlock for access to all 98 flashcards in this deck.
Unlock Deck
k this deck
25
A(n) ____ is a collection of code that has been programmed and translated by someone else, ready for use in your program.

A) method
B) class
C) parameter
D) library
Unlock Deck
Unlock for access to all 98 flashcards in this deck.
Unlock Deck
k this deck
26
A __________ contains sequences of instructions to perform a particular task.

A) parameter
B) label
C) variable
D) method
Unlock Deck
Unlock for access to all 98 flashcards in this deck.
Unlock Deck
k this deck
27
What is the name of the file declaring the class named MyClass?

A) MyClass
B) myclass.java
C) MyClass.class
D) MyClass.java
Unlock Deck
Unlock for access to all 98 flashcards in this deck.
Unlock Deck
k this deck
28
Parameters to methods are enclosed by these symbols.

A) ()
B) ""
C) {}
D) //
Unlock Deck
Unlock for access to all 98 flashcards in this deck.
Unlock Deck
k this deck
29
What term is used to refer to a sequence of characters enclosed in quotation marks?

A) string
B) object
C) comment
D) variable
Unlock Deck
Unlock for access to all 98 flashcards in this deck.
Unlock Deck
k this deck
30
In Java, every statement must end with this symbol.

A) )
B) )
C) !
D) ;
Unlock Deck
Unlock for access to all 98 flashcards in this deck.
Unlock Deck
k this deck
31
What term is used to refer to an instruction in a method?

A) statement
B) constant
C) comment
D) object
Unlock Deck
Unlock for access to all 98 flashcards in this deck.
Unlock Deck
k this deck
32
In a console window, how do you compile the declaration of the class MyClass?

A) javac MyClass.java
B) javac MyClass
C) java MyClass.java
D) java MyClass
Unlock Deck
Unlock for access to all 98 flashcards in this deck.
Unlock Deck
k this deck
33
The Java compiler ignores any text between ____.

A) (* and *)
B) /* and */
C) {* and *}
D) // and //
Unlock Deck
Unlock for access to all 98 flashcards in this deck.
Unlock Deck
k this deck
34
Every Java program consists of one or more of these fundamental building blocks.

A) class
B) CPU
C) applet
D) parameter
Unlock Deck
Unlock for access to all 98 flashcards in this deck.
Unlock Deck
k this deck
35
A method is called on what entity in the program?

A) constant
B) statement
C) comment
D) object
Unlock Deck
Unlock for access to all 98 flashcards in this deck.
Unlock Deck
k this deck
36
What entity belongs to a class and is manipulated in a program?

A) constant
B) package
C) object
D) comment
Unlock Deck
Unlock for access to all 98 flashcards in this deck.
Unlock Deck
k this deck
37
Which statement best describes the portability characteristic of Java?

A) It is easy to copy Java source code from one machine to another.
B) The same Java class files will run on different operating systems without change.
C) It is easy to compile Java source code on different operating systems.
D) It is easy to change a Java program so that it will work on different operating systems.
Unlock Deck
Unlock for access to all 98 flashcards in this deck.
Unlock Deck
k this deck
38
Text enclosed between this and the end of line is ignored by the compiler.

A) ''
B) //
C) ()
D) ""
Unlock Deck
Unlock for access to all 98 flashcards in this deck.
Unlock Deck
k this deck
39
What term is used to refer to information passed in to a method on a call?

A) class
B) object
C) parameter
D) comment
Unlock Deck
Unlock for access to all 98 flashcards in this deck.
Unlock Deck
k this deck
40
What is the name of the file that contains the Java source code for the class BankAccount?

A) BankAccount
B) BankAccount.java
C) BankAccount.class
D) BankAccount.txt
Unlock Deck
Unlock for access to all 98 flashcards in this deck.
Unlock Deck
k this deck
41
What is the output of the following Java statement? System.out.println("4 + 6");

A) 10
B) 46
C) 4
D) 4 + 6
Unlock Deck
Unlock for access to all 98 flashcards in this deck.
Unlock Deck
k this deck
42
What is the name of the file created after a successful compilation of MyClass.java?

A) MyClass.java
B) MyClass.class
C) myClass.class
D) MyClass
Unlock Deck
Unlock for access to all 98 flashcards in this deck.
Unlock Deck
k this deck
43
In a console window, assuming that BankAccountTester includes the main method, how do you run the program?

A) javac BankAccountTester
B) java BankAccountTester.class
C) javac BankAccountTester.java
D) java BankAccountTester
Unlock Deck
Unlock for access to all 98 flashcards in this deck.
Unlock Deck
k this deck
44
What is the object in the given method call? System.out.println("Welcome");

A) println
B) System.out
C) System.out.println
D) System
Unlock Deck
Unlock for access to all 98 flashcards in this deck.
Unlock Deck
k this deck
45
What type of program can you use to enter your Java program?

A) compiler
B) editor
C) spreadsheet
D) database
Unlock Deck
Unlock for access to all 98 flashcards in this deck.
Unlock Deck
k this deck
46
Which statement is true about a Java program?

A) Java forces the programmer to use a particular layout for readability.
B) Java requires that at most one statement appear on one line.
C) The first method that is executed in a Java program is called Main.
D) Java is case sensitive.
Unlock Deck
Unlock for access to all 98 flashcards in this deck.
Unlock Deck
k this deck
47
What is the name of the method in the given method call? System.out.println("Welcome");

A) "Welcome"
B) System
C) println
D) out
Unlock Deck
Unlock for access to all 98 flashcards in this deck.
Unlock Deck
k this deck
48
What does a class file contain?

A) Instructions for the specific CPU on the computer.
B) Instructions for the Java Virtual Machine.
C) The JVM instructions for all classes in the Java application.
D) The Java source code for a class.
Unlock Deck
Unlock for access to all 98 flashcards in this deck.
Unlock Deck
k this deck
49
What is the file extension of a Java class file?

A) )java
B) There is no file extension.
C) )class
D) )txt
Unlock Deck
Unlock for access to all 98 flashcards in this deck.
Unlock Deck
k this deck
50
What is a Java library?

A) A collection of Java source code that has been programmed and can be reused.
B) A collection of books on Java.
C) A collection of electronic documentation on Java.
D) A collection of code that has been programmed and translated by someone else, ready for you to use in your program.
Unlock Deck
Unlock for access to all 98 flashcards in this deck.
Unlock Deck
k this deck
51
The Java compiler translates source code into what type of file?

A) document
B) object
C) class
D) text
Unlock Deck
Unlock for access to all 98 flashcards in this deck.
Unlock Deck
k this deck
52
What is the name of the class declared in the file MyClass.java?

A) MyClass
B) MyClass.class
C) MyClass.java
D) myclass
Unlock Deck
Unlock for access to all 98 flashcards in this deck.
Unlock Deck
k this deck
53
What is the output of the following Java statement? System.out.println(4 + 6);

A) 4 + 6
B) 4
C) 10
D) 46
Unlock Deck
Unlock for access to all 98 flashcards in this deck.
Unlock Deck
k this deck
54
In a console window, what is the name of the command used to compile Java source code?

A) javac
B) javadoc
C) compile
D) java
Unlock Deck
Unlock for access to all 98 flashcards in this deck.
Unlock Deck
k this deck
55
In a console window, how do you compile the declaration of the class BankAccount?

A) java BankAccount
B) javac BankAccount
C) javac BankAccount.java
D) java BankAccount.java
Unlock Deck
Unlock for access to all 98 flashcards in this deck.
Unlock Deck
k this deck
56
Which of the following statements is true about running a Java program?

A) The Java compiler executes your program.
B) The Java virtual machine loads the instructions for the program that you wrote, starts your program, and loads the necessary library files as they are required.
C) The java compiler signals the JVM to execute the program.
D) The javadoc utility runs the documentation of the program.
Unlock Deck
Unlock for access to all 98 flashcards in this deck.
Unlock Deck
k this deck
57
What is the parameter in the given method call? System.out.println("Welcome");

A) out
B) println
C) "Welcome"
D) System
Unlock Deck
Unlock for access to all 98 flashcards in this deck.
Unlock Deck
k this deck
58
Suppose that a computer virus infects your computer and corrupts the files you were going to submit for your current homework assignment. What precaution could have saved you from a disastrously bad grade for this assignment?

A) Defragment the hard drive.
B) Purchase an anti-virus program to remove the virus from your computer.
C) Make regular backups of all your important files.
D) Purchase an extended warranty for your computer.
Unlock Deck
Unlock for access to all 98 flashcards in this deck.
Unlock Deck
k this deck
59
In a console window, what is the name of the command used to run a Java program?

A) javadoc
B) javac
C) java
D) run
Unlock Deck
Unlock for access to all 98 flashcards in this deck.
Unlock Deck
k this deck
60
What is the syntax for calling the println method on the object System.out?

A) println("Any message").System.out;
B) System.out("Any message").println;
C) System.out.println("Any message");
D) println(System.out, "Any message");
Unlock Deck
Unlock for access to all 98 flashcards in this deck.
Unlock Deck
k this deck
61
Assume that the following Java statement is contained in the main method of the class named Welcome: System.out.printLine("Welcome!");
What is the name of the file generated by the Java compiler?

A) Welcome.class
B) Welcome.java
C) No file is generated due to an error.
D) Welcome
Unlock Deck
Unlock for access to all 98 flashcards in this deck.
Unlock Deck
k this deck
62
Who or what is responsible for inspecting and testing the program to guard against logic errors?

A) JVM
B) programmer
C) end-user
D) compiler
Unlock Deck
Unlock for access to all 98 flashcards in this deck.
Unlock Deck
k this deck
63
Assume that the following Java statement is contained in the main method of the class named Hello: System.out.printLine("Hello!");
What is the name of the file generated by the Java compiler?

A) Hello.java
B) Hello
C) No file is generated due to an error.
D) Hello.class
Unlock Deck
Unlock for access to all 98 flashcards in this deck.
Unlock Deck
k this deck
64
Assuming the programmer wishes to output the phrase "Welcome!", which of the following is true about the following Java statement. System.out.Println("Wlcome!");

A) There are no errors.
B) There is a compile-time error.
C) There is a run-time error.
D) There are multiple errors.
Unlock Deck
Unlock for access to all 98 flashcards in this deck.
Unlock Deck
k this deck
65
What is defensive programming?

A) Writing a program that does not contain run-time errors.
B) Programming in a language that allows programmers to describe tasks at a higher conceptual level than machine code.
C) Structuring programs and development processes in such a way that an error in one part of the program does not trigger a disastrous response.
D) Writing a program that does not contain compile-time errors.
Unlock Deck
Unlock for access to all 98 flashcards in this deck.
Unlock Deck
k this deck
66
Assuming the programmer wishes to display "Hello!" on the screen, which statement is true about the following Java statement: System.out.printn("Helo!");

A) There is a run-time error.
B) There are no errors.
C) There is a compile-time error.
D) There are multiple errors.
Unlock Deck
Unlock for access to all 98 flashcards in this deck.
Unlock Deck
k this deck
67
Which statement is true about the following Java statement: System.out.println("Welcome!");

A) There are no errors.
B) There is a run-time error.
C) There are multiple errors.
D) There is a compile-time error.
Unlock Deck
Unlock for access to all 98 flashcards in this deck.
Unlock Deck
k this deck
68
Structuring programs and development processes in such a way that an error in one part of the program does not trigger a disastrous response is referred to as ____.

A) high-level programming
B) offensive programming
C) defensive programming
D) low-level programming
Unlock Deck
Unlock for access to all 98 flashcards in this deck.
Unlock Deck
k this deck
69
What is another term used to describe an error detected by the compiler that is a violation of the programming language rules?

A) typo
B) logic error
C) semantic error
D) run-time error
Unlock Deck
Unlock for access to all 98 flashcards in this deck.
Unlock Deck
k this deck
70
Assuming the programmer wishes to output the phrase "Hello!", which of the following is true about the following Java statement. System.out.println("Welcme!");

A) There are multiple errors.
B) There is a run-time error.
C) There are no errors.
D) There is a compile-time error.
Unlock Deck
Unlock for access to all 98 flashcards in this deck.
Unlock Deck
k this deck
71
What is another term used to describe an error causing a program to take an action that the programmer did not intend?

A) syntax error
B) logic error
C) mistake
D) compile-time error
Unlock Deck
Unlock for access to all 98 flashcards in this deck.
Unlock Deck
k this deck
72
Assuming the programmer wishes to display "Hello!" on the screen, which statement is true about the following Java statement: System.out.println("Hello!");

A) There is a run-time error.
B) There are no errors.
C) There is a compile-time error.
D) There are multiple errors.
Unlock Deck
Unlock for access to all 98 flashcards in this deck.
Unlock Deck
k this deck
73
Which statement is true about the following Java statement: System.out.println("Hello!);

A) There is a run-time error.
B) There are no errors.
C) There is a compile-time error.
D) There are multiple errors.
Unlock Deck
Unlock for access to all 98 flashcards in this deck.
Unlock Deck
k this deck
74
Which one of the following statements regarding backup strategies for Java files is correct?

A) You should have multiple copies of your source files in different locations.
B) You should regularly print out your work so you can retype it in case of data loss.
C) You should regularly back up the Java virtual machine instructions to prevent loss of valuable work.
D) Your compiler automatically makes backups of your source files.
Unlock Deck
Unlock for access to all 98 flashcards in this deck.
Unlock Deck
k this deck
75
What are special software tools called that let you trace through a program to find run-time errors?

A) compiler
B) debugger
C) CPU
D) virtual machine
Unlock Deck
Unlock for access to all 98 flashcards in this deck.
Unlock Deck
k this deck
76
What is the term used to describe an error detected by the compiler that is a violation of the programming language rules?

A) logic error
B) compile-time error
C) run-time error
D) typo
Unlock Deck
Unlock for access to all 98 flashcards in this deck.
Unlock Deck
k this deck
77
Which statement is true about the following Java statement: System.out.Println("Welcome!");

A) There are multiple errors.
B) There are no errors.
C) There is a run-time error.
D) There is a compile-time error.
Unlock Deck
Unlock for access to all 98 flashcards in this deck.
Unlock Deck
k this deck
78
What is the term used to describe an error causing a program to take an action that the programmer did not intend?

A) typo
B) run-time error
C) compile-time error
D) syntax error
Unlock Deck
Unlock for access to all 98 flashcards in this deck.
Unlock Deck
k this deck
79
Which statement is true about the compilation process?

A) The compiler will generate CPU specific instructions even if it detects an error.
B) The compiler will generate Java virtual machine instructions even if it detects an error.
C) The compiler will stop compiling when it finds the first error.
D) The compiler will continue compiling after it finds an error.
Unlock Deck
Unlock for access to all 98 flashcards in this deck.
Unlock Deck
k this deck
80
Assuming the programmer wishes to display "Hello!" on the screen, which statement is true about the following Java statement: System.out.println("Helo!");

A) There is a run-time error.
B) There are no errors.
C) There is a compile-time error.
D) There are multiple errors.
Unlock Deck
Unlock for access to all 98 flashcards in this deck.
Unlock Deck
k this deck
locked card icon
Unlock Deck
Unlock for access to all 98 flashcards in this deck.