1.
Before you start: if something is written in quotation marks("quote") then it means Java code
What is the name for an application that changes a human-readable programming language into a machine-readable language?
Correct Answer
A. Compiler
Explanation
A compiler is a program that translates a high-level programming language into machine code or a lower-level language that can be understood by the computer's processor. It takes the human-readable code and converts it into a machine-readable format, allowing the computer to execute the instructions. Therefore, a compiler is the correct answer for the name of an application that changes a human-readable programming language into a machine-readable language.
2.
Which applications can you use to edit Java code?
Correct Answer
D. Both A and B
Explanation
Both a text editor and software development environments (such as Eclipse or IDE) can be used to edit Java code. A text editor allows for manual editing of the code, while software development environments provide additional features like syntax highlighting, code completion, and debugging tools to aid in the development process. A graphic editor like Photoshop is not suitable for editing Java code, as it is primarily used for image editing. Therefore, the correct answer is "Both A and B."
3.
Does eclipse have another compiler then default Java one?
Correct Answer
B. No
Explanation
Eclipse does not have another compiler other than the default Java compiler. Eclipse uses the Java Development Tools (JDT) plugin, which internally utilizes the Java compiler (javac) provided by the Java Development Kit (JDK). This means that Eclipse uses the same compiler as the default Java compiler for compiling Java code. Therefore, the correct answer is "No."
4.
What will be output of x in following code?
"class Test{
public static void main(String[] args) {
int x = 1;
if (x == 1) {
x = x + 1}
}
}"
Correct Answer
C. 2
Explanation
The code initializes the variable x to 1. Then, it checks if x is equal to 1. Since the condition is true, the code inside the if statement is executed. The code increments the value of x by 1. Therefore, the final value of x will be 2.
5.
What is the difference between "int" and "INT"?
Correct Answer
B. "int" is not this same as "INT" because of java's case sensivity
Explanation
"int" and "INT" are not the same because of Java's case sensitivity. In Java, variable names are case sensitive, meaning that "int" and "INT" are considered to be two different identifiers. This means that if you declare a variable as "int", you cannot refer to it as "INT" or vice versa. Java treats them as separate entities and will throw an error if you try to use them interchangeably. Therefore, the correct answer is that "int" is not the same as "INT" because of Java's case sensitivity.
6.
What's the extension for a compiled Java file?
Correct Answer
A. .class
Explanation
The extension for a compiled Java file is .class. This is because when a Java program is compiled, it is converted into bytecode, which is stored in a .class file. This file can then be executed by the Java Virtual Machine (JVM). The .class extension distinguishes the compiled Java file from the original .java source code file.
7.
What's the common term for an error within a computer program's code that prevents it from functioning properly?
Correct Answer
C. A bug
Explanation
A bug is the common term for an error within a computer program's code that prevents it from functioning properly. Bugs can cause various issues such as crashes, unexpected behavior, or incorrect output. They can occur due to mistakes made by the programmer, compatibility issues, or other factors. The term "bug" originated from an incident where an actual insect caused a malfunction in a computer system.
8.
What is a variable?
Correct Answer
C. A way to hold data temporarily in a program
Explanation
A variable is a way to hold data temporarily in a program. It is used to store and manipulate values that can be changed during the execution of the program. Variables provide a means to store information that can be accessed and modified as needed, allowing for dynamic and flexible programming.
9.
What is "String"?
Correct Answer
B. Type of variable that stores text and numbers
Explanation
The correct answer is "Type of variable that stores text and numbers." This is because a string is a data type in programming that is used to represent text. It can store a combination of letters, numbers, and special characters. Therefore, it is a type of variable that can store both text and numbers.
10.
Why do we have to use "int" and "String"?
Correct Answer
D. All of these
Explanation
The correct answer is All of these. We have to use "int" and "String" because "String" is used for storing text and "int" is used for storing numbers. Additionally, "String" does not support math calculations. Furthermore, it is true that "String" takes more memory (RAM) than "int".
11.
What does SDK stand for?
Correct Answer
A. Software Development Kit
Explanation
An SDK stands for Software Development Kit. It is a collection of software tools, libraries, and documentation that developers use to create and maintain software applications for specific platforms or frameworks. The SDK provides a set of resources and tools that help developers streamline the development process, including sample code, debugging tools, and documentation.
12.
Is Java short for "JavaScript"?
Correct Answer
B. False
Explanation
Java is not short for "JavaScript". While both are programming languages, they are completely different and have distinct purposes. Java is a general-purpose programming language that is widely used for developing various applications, while JavaScript is primarily used for web development and adding interactivity to websites. Therefore, the statement "Java is short for 'JavaScript'" is false.