Intro. to Java Programming, Ninth Edition - Ch.1

¡Supera tus tareas y exámenes ahora con Quizwiz!

Which JDK command is correct to run a Java application in ByteCode.class? A. java ByteCode B. java ByteCode.class C. javac ByteCode.java D. javac ByteCode E. JAVAC ByteCode

A. java ByteCode //not apart of C169 material for WGU

Computer can execute the code in ____________. A. machine language B. assembly language C. high-level language D. none of the above

A. machine language

Which of the following are the reserved words? (choose more than one) A. public B. static C. void D. class

A. public B. static C. void D. class

One byte has ________ bits. A. 4 B. 8 C. 12 D. 16

B. 8

___________ translates high-level language program into machine language program. A. An assembler B. A compiler C. CPU D. The operating system

B. A compiler

__________ is the brain of a computer. A. Hardware B. CPU C. Memory D. Disk

B. CPU

________ is the physical aspect of the computer that can be seen. A. Hardware B. Software C. Operating system D. Application program

A. Hardware

________ is Architecture-Neutral. A. Java B. C++ C. C D. Ada E. Pascal

A. Java

________ is interpreted. A. Java B. C++ C. C D. Ada E. Pascal

A. Java

________ is an object-oriented programming language. (choose more than one) A. Java B. C++ C. C D. C# E. Pascal

A. Java B. C++ D. C#

Java compiler translates Java source code into _________. A. Java bytecode B. machine code C. assembly code D. another high-level language code

A. Java bytecode

________ is a technical definition of the language that includes the syntax and semantics of the Java programming language. A. Java language specification B. Java API C. Java JDK D. Java IDE

A. Java language specification

_________ is a software that interprets Java bytecode. A. Java virtual machine B. Java compiler C. Java debugger D. Java API

A. Java virtual machine

_____________ is a program that runs on a computer to manage and control a computer's activities. A. Operating system B. Java C. Modem D. Interpreter E. Compiler

A. Operating system

Java was developed by ____________. A. Sun Microsystems B. Microsoft C. Oracle D. IBM E. Cisco Systems

A. Sun Microsystems //developed by Sun Microsystems but later bought by Oracle in 2010

If you forget to put a closing quotation mark on a string, what kind error will be raised? A. a compilation error B. a runtime error C. a logic error

A. a compilation error

Every statement in Java ends with ________. A. a semicolon (;) B. a comma (,) C. a period (.) D. an asterisk (*)

A. a semicolon (;)

Which of the following are storage devices? (choose more than one) A. floppy disk B. hard disk C. flash stick D. CD-ROM

A. floppy disk B. hard disk C. flash stick D. CD-ROM

To use JOptionPane in your program, you may import it using: (choose more than one) A. import javax.swing.JOptionPane; B. import javax.swing.*; C. import javax.*; D. import javax.*.JOptionPane;

A. import javax.swing.JOptionPane; B. import javax.swing.*;

________ provides an integrated development environment (IDE) for rapidly developing Java programs. Editing, compiling, building, debugging, and online help are integrated in one graphical user interface. A. Java language specification B. Java API C. Java JDK D. Java IDE

D. Java IDE

____________ is a device to connect a computer to a local area network (LAN). A. Regular modem B. DSL C. Cable modem D. NIC

D. NIC //Network interface controller

Which of the following lines is not a Java comment? (choose more than one) (quizlet added some weird boldness here, please ignore) (A. /** comments */) (B. // comments) (C. -- comments) (D. /* comments */) (E. ** comments **)

(C. -- comments) (E. ** comments **) //Bonus information: /** comments */ - adds to the Javadoc file

The __________ method displays a message dialog box. (choose more than one) *A.* JOptionPane.showMessage(null, "Welcome to Java!", "Example 1.2 Output", JOptionPane.INFORMATION_MESSAGE); *B.* JOptionPane.displayMessage(null, "Welcome to Java!", "Example 1.2 Output", JOptionPane.INFORMATION_MESSAGE); *C.* JOptionPane.displayMessageDialog(null, "Welcome to Java!", "Example 1.2 Output", JOptionPane.INFORMATION_MESSAGE); *D.* JOptionPane.showMessageDialog(null, "Welcome to Java!", "Example 1.2 Output", JOptionPane.INFORMATION_MESSAGE); *E.* JOptionPane.showMessageDialog(null, "Welcome to Java!");

*D.* JOptionPane.showMessageDialog(null, "Welcome to Java!", "Example 1.2 Output", JOptionPane.INFORMATION_MESSAGE); *E.* JOptionPane.showMessageDialog(null, "Welcome to Java!");

The extension name of a Java source code file is A. .java B. .obj C. .class D. .exe

A. .java

Which of the following statements is correct? A. Every line in a program must end with a semicolon. B. Every statement in a program must end with a semicolon. C. Every comment line must end with a semicolon. D. Every method must end with a semicolon. E. Every class must end with a semicolon.

B. Every statement in a program must end with a semicolon.

________ contains predefined classes and interfaces for developing Java programs. A. Java language specification B. Java API C. Java JDK D. Java IDE

B. Java API

____________ are instructions to the computer. (choose more than one) A. Hardware B. Software C. Programs D. Keyboards

B. Software C. Programs

Which of the following statements is correct to display Welcome to Java on the console? (choose more than one) A. System.out.println('Welcome to Java'); B. System.out.println("Welcome to Java"); C. System.println('Welcome to Java'); D. System.out.print('Welcome to Java'); E. System.out.print("Welcome to Java");

B. System.out.println("Welcome to Java"); E. System.out.print("Welcome to Java") //double quotes are used for Strings and single quotes are for char

Java ___________ can run from a Web browser. A. applications B. applets C. servlets D. Micro Edition programs

B. applets

Why do computers use zeros and ones? A. because combinations of zeros and ones can represent any numbers and characters. B. because digital devices have two stable states and it is natural to use one state for 0 and the other for 1. C. because binary numbers are simplest. D. because binary numbers are the bases upon which all other number systems are built.

B. because digital devices have two stable states and it is natural to use one state for 0 and the other for 1.

A block is enclosed inside __________. A. parentheses B. braces C. brackets D. quotes

B. braces // Braces - {}

The extension name of a Java bytecode file is A. .java B. .obj C. .class D. .exe

C. .class //bytecode is a post-compiled file

________ consists of a set of separate programs for developing and testing Java programs, each of which is invoked from a command line. A. Java language specification B. Java API C. Java JDK D. Java IDE

C. Java JDK //JDK - Java Development Kit

____________ is an operating system. A. Java B. C++ C. Windows XP D. Visual Basic E. Ada

C. Windows XP

If a program compiles fine, but it produces incorrect result, then the program suffers __________. A. a compilation error B. a runtime error C. a logic error

C. a logic error //C169 with WGU makes a runtime error the same as a logic error in Everything with Java Ch. 1 p.15

Programming style is important, because ______________. (choose more than one) A. a program may not compile if it has a bad style B. good programming style can make a program run faster C. good programming style makes a program more readable D. good programming style helps reduce programming errors

C. good programming style makes a program more readable D. good programming style helps reduce programming errors

The JDK command to compile a class in the file Test.java is A. java Test B. java Test.java C. javac Test.java D. javac Test E. JAVAC Test.java

C. javac Test.java //not apart of C169 material for WGU

The speed of the CPU may be measured in __________. (choose more than one) A. megabytes B. gigabytes C. megahertz D. gigahertz

C. megahertz D. gigahertz

The main method header is written as: A. public static void main(string[] args) B. public static void Main(String[] args) C. public static void main(String[] args) D. public static main(String[] args) E. public void main(String[] args)

C. public static void main(String[] args) //capitalization matters to Java

Suppose you define a Java class as follows: public class Test { } In order to compile this program, the source code should be stored in a file named A. Test.class B. Test.doc C. Test.txt D. Test.java E. Any name with extension .java

D. Test.java //precompiled file is the key here


Conjuntos de estudio relacionados

Aceable Permit Test Prep: (Chapter 4&5)

View Set

Mental Health Evolve Adaptive Quizzing- Ch.25

View Set

Care/Prev Injuries Exam 1 Fall 2022

View Set

US history- The Progressive Movement

View Set

Series 63 Registration & Licensing

View Set

MRKT - CENGAGE QUIZ Ch.9 (Market Segmentation, Targeting, and Positioning)

View Set

Chapter 10: Stereotyping, Prejudice, and Discrimination

View Set

Africa & the Middle East Unit Test Review

View Set