Computer Applications
Assertion (A) Identifier is a name given to a package, class, interface, method or variable.
Reason (R) Identifier allows a programmer to refer to the item from other places in the program.
- Both Assertion (A) and Reason (R) are true and Reason (R) is a correct explanation of Assertion (A).
- Both Assertion (A) and Reason (R) are true and Reason (R) is not a correct explanation of Assertion (A).
- Assertion (A) is true and Reason (R) is false.
- Assertion (A) is false and Reason (R) is true.
Answer
Both Assertion (A) and Reason (R) are true and Reason (R) is a correct explanation of Assertion (A).
Reason — Assertion (A) is true because an identifier is indeed a name given to a package, class, interface, method, or variable. Reason (R) is true because identifiers allow a programmer to refer to the item from other places in the program, hence it is the correct explanation of Assertion (A).
Related Questions
What will be the output of following code?
String c = "Hello i love java"; boolean var; var = c.startsWith("hello"); System.out.println(var);- true
- false
- 0
- 1
A string function which removes the blank spaces provided in the prefix and suffix of a string.
- String.trim()
- String.ltrim()
- String.rtrim
- String.strim
Read the following text and choose the correct answer:
The Java compiler breaks the line of code into text (words) is called Java tokens. These are the smallest element of the Java program. The Java compiler identified these words as tokens. These tokens are separated by the delimiters. Java tokens help the compiler. Which of the following is a type of Java token?
- Identifiers
- Keywords
- Operators
- All of these
Assertion (A) next() can read the input only till the space.
Reason (R) next() only gets to the line break.- Both Assertion (A) and Reason (R) are true and Reason (R) is a correct explanation of Assertion (A).
- Both Assertion (A) and Reason (R) are true and Reason (R) is not a correct explanation of Assertion (A).
- Assertion (A) is true and Reason (R) is false.
- Assertion (A) is false and Reason (R) is true.