




















Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
Prepare for your exams
Study with the several resources on Docsity
Earn points to download
Earn points by helping other students or get them with a premium plan
JAVA PROGRAMMING TENTH EDITION ACTUAL EXAM SCRIPT 2026 COMPLETE QUESTIONS AND SOLUTIONS GRADED A PLUS OBJECT ORIENTED MASTER SET
Typology: Exams
1 / 28
This page cannot be seen from the preview
Don't miss anything!





















โ List five major hardware components of a computer. Answer: Five major hardware components: CPU, Memory, Storage Devices, Input/Out Devices, and Communication Devices. โ _ is the physical aspect of the computer that can be seen. A. Hardware B. Software C. Operating system D. Application program Answer: A. Hardware โ _ is the brain of a computer. A. Hardware B. CPU C. Memory D. Disk
Answer: B. CPU โ _ is the physical aspect of the computer that can be seen. A. Hardware B. Software C. Operating system D. Application program Answer: A. Hardware โ __________ is the brain of a computer. A. Hardware B. CPU C. Memory D. Disk Answer: B. CPU โ The speed of the CPU may be measured in __________. A. megabytes B. gigabytes C. megahertz D. gigahertz Answer: C. megahertz
C. flash stick D. CD-ROM E. main memory Answer: E. main memory โ ____________ is a device to connect a computer to a local area network (LAN). A. Regular modem B. DSL C. Cable modem D. NIC Answer: D. NIC โ ____________ are instructions to the computer. A. Hardware B. Software C. Programs D. Keyboards Answer: B. Software C. Programs โ Computer can execute the code in ____________.
A. machine language B. assembly language C. high-level language D. none of the above Answer: A. machine language โ ___________ translates high-level language program into machine language program. A. An assembler B. A compiler C. CPU D. The operating system Answer: B. A compiler โ ____________ is an operating system. A. Java B. C++ C. Windows D. Visual Basic E. Ada Answer: C. Windows
D. Micro Edition programs Answer: B. applets โ ________ is not an object-oriented programming language. A. Java B. C++ C. C D. C# E. Python Answer: C. C โ ________ is interpreted. A. Java B. C++ C. C D. Ada E. Pascal Answer: A. Java โ ________ is architecture-neutral. A. Java B. C++
D. Ada E. Pascal Answer: A. Java โ ________ 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 Answer: A. Java language specification โ ________ contains predefined classes and interfaces for developing Java programs. A. Java language specification B. Java API C. Java JDK D. Java IDE Answer: B. Java API
D. public static main(String[] args) E. public void main(String[] args) Answer: C. public static void main(String[] args) โ 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. Answer: B. Every statement in a program must end with a semicolon. โ 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.println('Welcome to Java"); E. System.out.println("Welcome to Java'); Answer: B. System.out.println("Welcome to Java");
โ 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 Answer: C. javac Test.java โ 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 Answer: A. java ByteCode โ Java compiler translates Java source code into _________. A. Java bytecode B. machine code C. assembly code D. another high-level language code
โ The extension name of a Java bytecode file is A. .java B. .obj C. .class D. .exe Answer: C. .class โ The extension name of a Java source code file is A. .java B. .obj C. .class D. .exe Answer: A. .java โ Which of the following lines is not a Java comment? A. /** comments / B. // comments C. -- comments D. / comments */ E. ** comments ** Answer: C. -- comments E. ** comments **
โ Which of the following are the reserved words? A. public B. static C. void D. class Answer: A. public B. static C. void D. class โ Every statement in Java ends with ________. A. a semicolon (;) B. a comma (,) C. a period (.) D. an asterisk (*) Answer: A. a semicolon (;) โ A block is enclosed inside __________. A. parentheses B. braces C. brackets
System.out.println("Welcome to Java!"); } } A. Both I and II can compile and run and display Welcome to Java, but the code in II has a better style than I. B. Only the code in I can compile and run and display Welcome to Java. C. Only the code in II can compile and run and display Welcome to Java. D. Both I and II can compile and run and display Welcome to Java, but the code in I has a better style than II. Answer: D. Both I and II can compile and run and display Welcome to Java, but the code in I has a better style than II. โ Which of the following code has the best style? I: public class Test { public static void main(String[] args) { System.out.println("Welcome to Java!"); } } II: public class Test {
public static void main(String[] args) { System.out.println("Welcome to Java!"); } } III: public class Test { public static void main(String[] args) { System.out.println("Welcome to Java!"); } } IV: public class Test { public static void main(String[] args) { System.out.println("Welcome to Java!"); } } A. I B. II C. III D. IV
โ What is a bit? What is a byte? Answer: A bit is a binary digit 0 or 1. A byte is a sequence of 8 bits. โ What is memory for? What does RAM stand for? Why is memory called RAM? Answer: Memory is like a work area for programs. Before a program is executed, it is brought into the memory. RAM stands for random- access memory. It is called RAM because a memory cell can be accessed directly. โ What unit is used to measure memory size? What unit is used to measure disk size? Answer: Memory size is measured in bytes. Disk size is measured in bytes. โ What is the primary difference between memory and a storage device? Answer: Memory is volatile, because information is lost when the power is turned off. Programs and data are permanently stored on storage devices and are moved, when the computer actually uses them, to memory, which is much faster than storage devices. โ What language does the CPU understand?
Answer: The machine language is a set of primitive instructions built into every computer. This is the language understood by a computer and executed by a computer. โ What is an assembly language? What is an assembler? Answer: Assembly language is a low-level programming language in which a mnemonic is used to represent each of the machine language instructions. Assembler is a software that translates assembly language into machine language. โ What is a high-level programming language? What is a source program? Answer: The high-level languages are English-like and easy to learn and program. The program written in a programming language is called a source program. โ What is an interpreter? What is a compiler? Answer: An interpreter is a software that reads one statement from the source code, translates it to the machine code or virtual machine code, and then executes it right away. A compiler is a software that translates a program in high-level language into machine language code.