Mark the following statements true or false. An identifier ca be any sequence of
ID: 3592159 • Letter: M
Question
Mark the following statements true or false.
An identifier ca be any sequence of digits and letters.
In Java, there is no difference between a reserved word and a predefined identifier.
A Java identifier can start with a digit.
The operands of the modulus operator must be integers. If the value of a is 4 and the value of b is 3 , then after the statement a=b; the value of b is still 3. In an output statement, the newline character may be part of the string.
The following is a legal Java program:
public class JavaProgram { public static void main (String [] args) { } }
Suppose x= 5. After the statement y=x++; executes, y is 5 and x is 6.
Suppose a=5. After the statement ++a; executes, the value of a still 5 because the value of the expression is not saved in another variable.
All you have to do is answer True or False
Explanation / Answer
Answers:
1). An identifier can be any sequence of digits and letters. - FALSE
Exaplanation: In java, all identifiers must begin with a letter, an underscore, or a Unicode currency character. Any other symbol, such as a number, is not valid.
2).In Java, there is no difference between a reserved word and a predefined identifier. - TRUE
Explanation: Reserved words are identifiers, which are predifined in java programming language and it has special meaning for each
3).A Java identifier can start with a digit. - FALSE
Exaplanation: In java, all identifiers must begin with a letter, an underscore, or a Unicode currency character. Any other symbol, such as a number, is not valid.
4).The operands of the modulus operator must be integers. If the value of a is 4 and the value of b is 3 , then after the statement a=b; the value of b is still 3. In an output statement, the newline character may be part of the string. -FALSE
5). The following is a legal Java program: -TRUE
public class JavaProgram { public static void main (String [] args) { } }
6).Suppose x= 5. After the statement y=x++; executes, y is 5 and x is 6. - TRUE
7).Suppose a=5. After the statement ++a; executes, the value of a still 5 because the value of the expression is not saved in another variable. -FALSE
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.