Question
1. For each of the following, indicate if it is a valid Java identifier or not. (An identifier is any word you use in a
1.
For each of the following, indicate if it is a valid Java identifier or not. (An identifier is any word you use in a program, not just a variable name.)
If it is valid, explain what it would identify using the normal naming conventions.
If it is not valid, explain why it is not valid.
a. 92ndStreet
Valid?
Choice 1 of 2:Yes
Choice 2 of 2:No
2.) Please look through the items below:
Line #01: public class HelloWorld { Line #02: Line #03: public static void main(String[] args) { Line #04: Line #05: int[] intVals = new int[7]; Line #06: Line #07: for (int i = 0; i < intVals.length; i++) { Line #08: Line #09: intVals[i] = (int) Math.pow(2, 7); Line #10: Line #11: if (intVals[i] % 3 == 0) Line #12: Line #13: System.out.println(intVals[i] + Line #14: " is a multiple of 3"); Line #15: } Line #16: Line #17: } Line #18: Line #19: }
a) Indicate each Reserved Word, including the line number(s) it appeared, from the code above. (indicate 7 reserved words)
b) Indicate each class name, including the line number(s) it appeared, from the code above. (3 class names)
c) Indicate each variable or method name, including the line number(s) it appeared, from the code above. ( 5 variable or method name)
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started