Java Chapter 1 UPDATED ACTUAL Exam Questions and
CORRECT Answers
Java language specification - is a technical definition of the language that includes the syntax and
semantics of the Java programming language.
Java API - contains predefined classes and interfaces for developing Java programs.
Java JDK - consists of a set of separate programs for developing and testing Java programs, each
of which is invoked from a command line.
Which of the following statements is correct to display Welcome to Java on the console?
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"); - Which of the following statements is correct to
display Welcome to Java on the console?
B and E
javac Test.java - The JDK command to compile a class in the file Test.java is
Java bytecode - Which JDK command is correct to run a Java application in ByteCode.class?
JVM (Java Virtual Machine) - is a software that interprets Java bytecode
, Test.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
.class - The extension name of a Java bytecode file is
.java - The extension name of a Java source code file is
logic error - If a program compiles fine, but it produces incorrect result, then the program suffers
__________.
compilation error - If you forget to put a closing quotation mark on a string, what kind error will
be raised?
What is the Anatomy of a Java Program - Class name
Main Method
Statements
Statement Terminator
Reserved Words
Comments
Blocks
What is the naming conventions of a class? - Capitalize the first letter of each word in a name.
CORRECT Answers
Java language specification - is a technical definition of the language that includes the syntax and
semantics of the Java programming language.
Java API - contains predefined classes and interfaces for developing Java programs.
Java JDK - consists of a set of separate programs for developing and testing Java programs, each
of which is invoked from a command line.
Which of the following statements is correct to display Welcome to Java on the console?
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"); - Which of the following statements is correct to
display Welcome to Java on the console?
B and E
javac Test.java - The JDK command to compile a class in the file Test.java is
Java bytecode - Which JDK command is correct to run a Java application in ByteCode.class?
JVM (Java Virtual Machine) - is a software that interprets Java bytecode
, Test.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
.class - The extension name of a Java bytecode file is
.java - The extension name of a Java source code file is
logic error - If a program compiles fine, but it produces incorrect result, then the program suffers
__________.
compilation error - If you forget to put a closing quotation mark on a string, what kind error will
be raised?
What is the Anatomy of a Java Program - Class name
Main Method
Statements
Statement Terminator
Reserved Words
Comments
Blocks
What is the naming conventions of a class? - Capitalize the first letter of each word in a name.