Provide Java code to illustrate how to create an array, reference an array, and address an element of an array.
1 answer:
Answer:
Hi!
<u>To create an array:</u>
type[] varname OR type varname[]
where:
- type is the class of the array.
- var-name is the name of the variable.
- [] indicates that the instance would be an array.
Examples:
float floatArray[];
boolean[] booleanArray;
String[] stringArray;
Object objectArray[];
<u>To reference an array:</u>
type varname1[];
type varname2[] = varname1;
where:
- After assign varname1 to varname2, varname2 points to the elements of varname1;
<u>To address an element in an array</u>:
type varname[n];
type i = varname[i];
If you want to access to the i element of the array you can do : varname[i];
You might be interested in
It is the 8-bit priority field hopes it helps
Answer:
Please elaborate more your question so I can answer your question accurately.
Explanation:
Answer:
Line graphs allow us to see overall trends such as an increase or decrease in data over time. Bar graphs are used to compare facts.
Answer:
Pay attention in your class.
Explanation:
If you paid attention in your class, you would have at least a basic understanding of the material.
Answer:
rhymeWord
Explanation:
correct answer edge 2020