1.
Which of the following is NOT a strength of Java language?
Correct Answer
D. High Speed Execution
Explanation
Java is known for its portability, as it can run on any platform that has a Java Virtual Machine. It is also relatively simple compared to other programming languages, making it easier for developers to learn and use. Additionally, Java is cost-effective as it is an open-source language, meaning it is free to use and has a wide range of libraries and frameworks available. However, high-speed execution is not considered a strength of Java. While Java is fast, it is not as fast as some other programming languages like C or C++.
2.
Java is NOT completely object-oriented because __________
Correct Answer
A. Java support primitive data types such as int, float...
Explanation
Java is not completely object-oriented because it supports primitive data types such as int and float. In object-oriented programming, everything is treated as an object, but primitive data types in Java are not objects. They are not instantiated from a class and do not have methods or attributes like objects do. This means that Java has a mix of both object-oriented and procedural programming features, making it not completely object-oriented.
3.
Which of the following is NOT a Java program?
Correct Answer
C. Javascript
Explanation
Javascript is not a Java program because it is a scripting language that is primarily used for front-end web development, whereas Java is a general-purpose programming language. Although they share similar names, they are different languages with different purposes and syntax. While Java is compiled and runs on a virtual machine, Javascript is interpreted and runs directly in web browsers.
4.
What is the file extension of your Java source file?
Correct Answer
B. .java
Explanation
The file extension of a Java source file is .java. This extension is used to identify files that contain Java programming code.
5.
The Java compiler translate the Java code into ______
Correct Answer
C. Bytecode
Explanation
The Java compiler translates the Java code into bytecode. Bytecode is a low-level representation of the Java code that can be executed by the Java Virtual Machine (JVM). It is a platform-independent format that allows Java programs to be run on any device or operating system that has a JVM installed. The JVM interprets the bytecode and converts it into machine code that can be executed by the underlying hardware. This compilation process enables Java programs to be portable and run efficiently on different platforms.
6.
In order to execute a Java application, you need to have ______ on your computer
Correct Answer
A. Java Virtual Machine
Explanation
To execute a Java application, you need to have Java Virtual Machine (JVM) on your computer. JVM is a virtual machine that allows the computer to run Java programs. It interprets the Java bytecode and translates it into machine code that can be executed by the computer's operating system. Without JVM, the computer would not be able to understand and execute Java programs.
7.
Which of following is NOT basic control structures?
Correct Answer
D. None of above
Explanation
The given question asks for the control structure that is not considered basic. The options provided are Sequence, Decision, Iteration, and None of above. Sequence, Decision, and Iteration are all basic control structures commonly used in programming. Therefore, the correct answer is None of above, indicating that all the given options are basic control structures.
8.
Which of following is NOT one of the steps of program development life cycle discussed in the class?
Correct Answer
C. Install the program
Explanation
The correct answer is "Install the program". In the program development life cycle, the steps include defining the problem, coding the program, testing and debugging the program. However, installing the program is not considered a step in the development process. Installation typically occurs after the program has been developed and tested, and it involves deploying the program onto the intended system or device.
9.
Assembly language has one-to-one mapping to the machine language code
Correct Answer
A. True
Explanation
Assembly language is a low-level programming language that is specific to a particular computer architecture. It uses mnemonic codes to represent machine instructions, making it easier for programmers to understand and write code. Each assembly language instruction corresponds directly to a machine language instruction, resulting in a one-to-one mapping. This means that every assembly language instruction can be directly translated into its equivalent machine language code. Therefore, the given statement is true.
10.
Documentation takes place only after testing and debugging the program
Correct Answer
B. False
Explanation
Documentation does not necessarily take place only after testing and debugging the program. In fact, documentation is an ongoing process that can occur at any stage of the software development lifecycle. It is important to document the program throughout its development to ensure clarity, maintainability, and ease of understanding for future reference. Therefore, the statement that documentation only takes place after testing and debugging the program is incorrect.
11.
A program that can be compiled successfully will not have any syntax errors.
Correct Answer
A. True
Explanation
A program that can be compiled successfully means that it is written in a way that follows the syntax rules of the programming language. Syntax errors occur when the program is not written correctly according to these rules, such as missing semicolons or using incorrect keywords. Therefore, if a program can be compiled successfully, it implies that there are no syntax errors present in the code. Hence, the statement "A program that can be compiled successfully will not have any syntax errors" is true.
12.
Which of the following Java programs can only be run using Web browser?
Correct Answer
B. Applet
Explanation
An applet is a Java program that can only be run using a web browser. Unlike other options like Servlet, JavaBeans, and EJB, which can be run on a server or standalone environment, applets are specifically designed to be embedded within webpages and executed within a web browser. They are typically used to add interactive functionalities to webpages and require the Java plugin to be installed in the browser for execution.
13.
CPU from different manufacturers have the same machine code for each operation.
Correct Answer
B. False
Explanation
The statement is false because different CPU manufacturers use different instruction sets and architectures. Each manufacturer has their own unique machine code for each operation. Therefore, the machine code for a particular operation on one CPU may not be the same as the machine code for the same operation on a CPU from a different manufacturer.
14.
Java employs both a compiler and an interpreter to produce an executable program
Correct Answer
A. True
Explanation
Java employs both a compiler and an interpreter to produce an executable program. This statement is true because Java uses a compiler to convert the source code into bytecode, which is a platform-independent representation of the program. The bytecode is then interpreted by the Java Virtual Machine (JVM) at runtime to execute the program. This combination of compilation and interpretation allows Java programs to be portable and run on any device that has a compatible JVM.
15.
The Java language was developed by __________
Correct Answer
D. Sun Microsystem
Explanation
The correct answer is Sun Microsystem. Sun Microsystem was the company that originally developed the Java language.
16.
Assembly language employs alphabetic abbreviations called ________
Correct Answer
B. Mnemonics
Explanation
Assembly language employs alphabetic abbreviations called mnemonics. Mnemonics are used to represent specific instructions or operations in assembly language programming. These abbreviations make it easier for programmers to write and understand code, as they are more intuitive and human-readable compared to the binary machine code. By using mnemonics, programmers can write assembly language instructions that correspond to specific machine code instructions, making it more efficient and convenient to program in assembly language.