Ask Question
14 April, 14:21

Write a statement to declare and initialize an array named denominations that contains exactly 6 elements of type of int. Your declaration statement should initialize the elements of the array to the following values : 1, 5, 10, 25, 50, 100. (The value 1 goes into the first element, the value 100 to the last.)

+2
Answers (1)
  1. 14 April, 16:16
    0
    int [ ] denominations = {1, 5, 10, 25, 50, 100};

    Explanation:

    In Java programming language, an array can be declared in two ways:

    By creating the array object with the specified size using the new keyword, int [] denominations = new int [6]; This will create an empty array object called denominations The second way is declaring and initializing the values of the array as has been done in the question.
Know the Answer?
Not Sure About the Answer?
Find an answer to your question ✅ “Write a statement to declare and initialize an array named denominations that contains exactly 6 elements of type of int. Your declaration ...” in 📘 Computers and Technology if you're in doubt about the correctness of the answers or there's no answer, then try to use the smart search and find answers to the similar questions.
Search for Other Answers