1.
It is the characteristics of Java which ensures that program can go only where it is designed to go and eliminates the possibility of altering system data unintentionally.
Correct Answer
C. Java is secure.
Explanation
The given statement describes one of the characteristics of Java, which is its ability to ensure that a program can only go where it is designed to go and eliminates the possibility of unintentionally altering system data. This refers to the security feature of Java, which helps protect the integrity and confidentiality of data and prevents unauthorized access or malicious activities.
2.
It is a form of Java program that runs locally on the command line.
Correct Answer
B. Application
Explanation
An application is a form of Java program that runs locally on the command line. Unlike applets, which are designed to run within a web browser, applications are standalone programs that can be executed directly on a computer. They have access to the full functionality of the operating system and can perform tasks such as file I/O, network communication, and user interaction. Applications are commonly used for desktop software development and are not limited by the restrictions imposed on applets.
3.
It defines the common variables and methods of a set of objects.
Correct Answer
B. Class
Explanation
A class is a blueprint or template that defines the common variables and methods of a set of objects. It represents a category or type of objects and provides a structure for creating instances (objects) of that class. Objects created from a class inherit the attributes and behaviors defined in the class, allowing for code reuse and organization. In this context, the given answer accurately describes the purpose and functionality of a class.
4.
It is an instance of a class.
Correct Answer
D. Object
Explanation
The given statement suggests that the correct answer is "object". This means that the statement is referring to something that is an instance of a class. In object-oriented programming, objects are created from classes and represent specific instances of that class. Therefore, an object is a valid explanation for the given statement.
5.
It is the process of removing errors found in the program.
Correct Answer
C. Debugging
Explanation
Debugging is the process of identifying and removing errors or bugs in a program. It involves systematically analyzing the code, identifying the cause of the error, and making the necessary corrections to ensure the program functions correctly. Debugging is an essential step in the software development process as it helps improve the program's reliability and performance. It allows programmers to identify and fix any issues that may cause the program to crash, produce incorrect results, or behave unexpectedly.
6.
Which of the following is the data type used for a single character?
Correct Answer
B. Char
Explanation
The data type used for a single character is char. Char is a primitive data type in many programming languages, including Java and C++. It is used to store a single character, such as a letter, number, or symbol. Char variables are typically enclosed in single quotes, like 'A' or '5'.
7.
Which symbol is used to denote a multi-line comment?
Correct Answer
B. /* */
Explanation
The symbol /* */ is used to denote a multi-line comment in programming languages. This allows the programmer to add explanatory or descriptive text within the code that is ignored by the compiler or interpreter. The text enclosed within the /* */ symbols will not be executed as part of the program and is typically used for documentation purposes or to temporarily disable a block of code.
8.
Which of the following is NOT a Java keyword?
Correct Answer
C. Of
Explanation
The keyword "of" is not a valid Java keyword. Java keywords are reserved words that have a specific meaning and cannot be used as identifiers in a program. The keyword "default" is used in switch statements, "for" is used for loop control, and "volatile" is used for thread synchronization. However, "of" is not a recognized keyword in the Java language.
9.
Which of the following is NOT a primitive data type?
Correct Answer
D. String
Explanation
The data type "String" is not a primitive data type. Primitive data types in programming languages are the basic building blocks and are predefined by the language. They include numeric types like byte, char, and long, but String is not a numeric type. Instead, it is a class in many programming languages that represents a sequence of characters.
10.
Which of the following is an invalid first character of an identifier?
Correct Answer
D. 8
Explanation
The first character of an identifier cannot be a number. Identifiers in programming are used to name variables, functions, or other entities. They must follow certain rules, and one of them is that the first character cannot be a number. It can only be a letter (A-Z or a-z), an underscore (_), or a dollar sign ($). Therefore, option 8 is an invalid first character for an identifier.