Answer:
The answer is "Option (i)".
Explanation:
- In the given question, an array is defined. It is a collection of the same type of data element, which means, array stores either a numeric value or string value at a time.
- An array beta is defined, which contains 50 elements. The array elements indexing always starts with 0 which means, the first element of the array will be stored in an index value that is 0. That's why option (i) is correct.
Answer:
The output streams to this question is "output.print(message)".
Explanation:
The description of the following can be given as:
- In the given question it is define a string datatype variable that is "message".
- Then we create a reference variable of PrintWriter class that is "output" and call string type variable that is message by the use of the print function we print message.
Answer:
Correct answer is option (2) that is "return".
Explanation:
In any programming language, a variable name can be made up of letters (lower and upper case) and digits. we can also use "_" underscore character for declaring the variables but we cannot use any special character like “$”.We cannot use digits in the beginning of variables name. And we also cannot use reserved keywords of the language like "new","return","while" etc. There should not be space between the variable names. Options 1, 3 and 4 are not violating any of these properties. But in option (2), "return" is a reserved keyword. That is why it is not a valid variable name.
Some example of valid variables name:
foo
BAZ
Bar
_foo42
foo_bar
Some example of invalid variables name:
$foo ($ not allowed)
while ( keywords )
2foo (started with digit)
my foo (spaces )