1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
ololo11 [35]
4 years ago
13

Provide Java code to illustrate how to create an array, reference an array, and address an element of an array.

Computers and Technology
1 answer:
tia_tia [17]4 years ago
4 0

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
The file extension for Access 2007 and 2010 database filenames is .accdb. What is the file extension for older versions of Acces
Vikentia [17]
<span>The earlier file format was the .mdb file format. If a person has a file that is stored in the .mdb format and gets a new version of Access or needs an upgrade, he or she may choose not to upgrade due to the fact that he or she will not be able to make design changes to the .mdb file.</span>
4 0
4 years ago
Write a program to assign distinct number between 1 and 200 into an int array of 100 elements in ascending order (you may reuse
Alexus [3.1K]

Answer:

import java.util.Arrays;

public class num2 {

   public static void main(String[] args) {

       int []intArray = new int[100];

       for(int i=0; i<intArray.length; i++){

       intArray[i] = i+1;

       }

       System.out.println(Arrays.toString(intArray));

   }

}

Explanation:

Firstly create an array of size 100 with this statement

int []intArray = new int[100];

Using a for loop add elements into the array starting at i=0+1 (to acheive an asceending order) since i will run from 0-99.

see the attached code and output

7 0
3 years ago
What naming scheme identifies the rows in a worksheet?
UNO [17]
The naming scheme would be b


3 0
3 years ago
Read 2 more answers
Given the following data definition
Mashcka [7]

Answer:

Array + 36.

Explanation:

The array contains the address of the first element or the starting address.So to find the address of an element we to add the size*position to the starting address of the array.Which is stored in the variable or word in this case.

There are 9 elements in the array and the size of integer is 4 bytes.So to access the last element we have to write

array + 4*9

array+36

4 0
3 years ago
The ____ allows a core to communicate with other cpu components, such as the memory controller and other cores
Gnoma [55]
The appropriate response is Bus Interface Unit or BIU. The BIU gives different capacities, including era of the memory and I/O addresses for the exchange of information between outside the CPU, and the EU. 
The EU gets program direction codes and information from the BIU, executes these guidelines, and store the outcomes in the general registers. By passing the information back to the BIU, information can likewise be put away in a memory area or kept in touch with a yield gadget. Note that the EU has no association with the framework transports. It gets and yields every one of its information through the BIU.
4 0
4 years ago
Other questions:
  • A video conferencing application isn't working due to a Domain Name System (DNS) port error. Which record requires modification
    15·1 answer
  • If you’d like to have multiple italicized words in your document, how would you change the font of each of these words?
    12·2 answers
  • The email administrator has suggested that a technique called SPF should be deployed. What issue does this address?
    5·1 answer
  • Which of the following is the java comparison operator for "not equal to"
    10·1 answer
  • How do you leave a conversation or group text on iphone (ios 10)? Help!!
    5·1 answer
  • IN C++ PLEASE!!!! Define a function FilterStr() that takes a string parameter and returns "Good" if the character at index 4 in
    7·1 answer
  • Which one is not considered part of the cinematography team?
    7·2 answers
  • When attaching a file or files in outlook 365 you select the attach command and then select the files location
    5·1 answer
  • Which of the following represents a backup system that will aid in recovery for any type of disaster or disruption?
    8·1 answer
  • The result of processing data ​
    10·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!