Question

[Multiple correct answers] Write a line of Java code to create an array of integers called...

[Multiple correct answers] Write a line of Java code to create an array of integers called studentIDs that can hold 1200 values.

  

int [] studentIDs = new int[1200];

   

int studentIDs [] = new int[1200];

   

int studentIDs = new int[1200];

   

int [] studentIDs = new int(1200);

   

int studentIDs [] = new int(1200);

   

int [] studentIDs = int[1200];

   

int studentIDs [] = int[1200];

Homework Answers

Answer #1
int [] studentIDs = new int[1200];
Correct.

int studentIDs [] = new int[1200];
Correct.

int studentIDs = new int[1200];
Wrong. Because there should be [] at left side of assignment operator

int [] studentIDs = new int(1200);
Wrong. Because we have to use [ and ] instead of ( and }

int studentIDs [] = new int(1200);
Wrong. Because we have to use [ and ] instead of ( and }

int [] studentIDs = int[1200];
Wrong. Because we have to new key word right side of assignment operator

int studentIDs [] = int[1200];
Wrong. Because we have to new key word right side of assignment operator


Java code to create an array of integers called studentIDs that can hold 1200 values
int [] studentIDs = new int[1200];
int studentIDs [] = new int[1200];

Know the answer?
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for?
Ask your own homework help question
Similar Questions
JAVA CODE Write a program which has a 3D array and prints the integers from the...
JAVA CODE Write a program which has a 3D array and prints the integers from the array. Then then convert the output into a file using filewriter
1. a. Write the Java code to fill a Java array of ints of size 100...
1. a. Write the Java code to fill a Java array of ints of size 100 with the value -1. b. Write the Java code to create an ArrayList of Strings, and add the Strings "Just", "Do", "It!" to it.
Write Java code that creates an array of primitive integers named odds and stores all odd...
Write Java code that creates an array of primitive integers named odds and stores all odd numbers between -6 and 38 using a for loop. (Your code will populate the array.) Your code should also enable the array’s size to be exactly large enough to store the numbers. (You will not put a number for the size, your code will determine the number.) (5 pt)
Write a Java part code to do the following   : ** Suppose a file called infile stored...
Write a Java part code to do the following   : ** Suppose a file called infile stored in drive D: ,filled with five integers(1000,200,3030,40 and 500) Read  the integers from infile then store them in array called ar[] and print it elements. Method called search( ) to print the location of   value 500. Method called sort() to sort array elements. Build another file called outfile in drive D: to save the sorted array elements . Note : Use ArrayIndexOutOfBoundsException when you use array...
Write a Java program that asks the user to enter an array of integers in the...
Write a Java program that asks the user to enter an array of integers in the main method. The program should prompt the user for the number of elements in the array and then the elements of the array. The program should then call a method named isSorted that accepts an array of and returns true if the list is in sorted (increasing) order and false otherwise. For example, if arrays named arr1 and arr2 store [10, 20, 30, 41,...
Write Java code to create a 2D array that mimics the one below. Do not use...
Write Java code to create a 2D array that mimics the one below. Do not use curly brackets to assign values. Instead, use nested loops and if-else or switch. x o o o x o x o x o o o z o o o x o x o x o o o x
This is JAVA Write the method findMin that will return the smallest number in an array...
This is JAVA Write the method findMin that will return the smallest number in an array of integers. Examples: findMin({29,2,32,12}) -> 2 public int findMin(int[] numbers) {    }
Write an application in Java which includes an algorithm that takes an array of any size,...
Write an application in Java which includes an algorithm that takes an array of any size, selects the high and low integer from the array of integers with each pass and builds a new array of integers by inserting the high and low selection with each pass. Your output should show the original array of integers and the output of each pass on a new line. Note: You can assume all integers are positive, but your code must work for...
Write a program that uses an array of integers initialized to whatever values you wish. Write...
Write a program that uses an array of integers initialized to whatever values you wish. Write a methods to calculate and return the minimum and a method to calculate and return the maximum value in the array. Write an additional method that accepts the array as a parameter and then creates and returns a new array with all the same values as the original plus 10. (num +=10) In Java
Instructions Write a Java code Your goal is to take N integer inputs from the user...
Instructions Write a Java code Your goal is to take N integer inputs from the user -- N's value will be given by the user as well. You can assume the user provides a valid value for N, i.e., >0. Store the input integers in an array of size N in the order they are provided. These tasks should be done in the main() method. Create a new method called checkArray() that will take the previously created array as input...
ADVERTISEMENT
Need Online Homework Help?

Get Answers For Free
Most questions answered within 1 hours.

Ask a Question
ADVERTISEMENT