Help please with array...
The array nums is a 10 element array of type int that has already been declared and initialized. Write the expression(s) in the box below that prints the sum of the first and second elements of nums to the console:
(Remember: the first element of an array is at index position 0).
Heres my code
print array[0] + array[1]
it says add a ']' but i dont understand why
Re: Help please with array...
Where does "print" come from? Asking because to my knowledge, this is the standard way of printing something to the console in java:
Code java:
System.out.print( something );
Or if you want to print a line:
Code java:
System.out.println( something );
Also, be sure not to forget the ; sign at the end of it.