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
evablogger [386]
3 years ago
6

Consider the following statement, which is intended to create an ArrayList named years that can be used to store elements both o

f type Integer and of type String. /* missing code */ = new ArrayList(); Which of the following can be used to replace /* missing code */ so that the statement compiles without error?
a. ArrayList years
b. ArrayList years()
c. ArrayList years[]
d. ArrayList years
e. ArrayList years
Computers and Technology
1 answer:
zvonat [6]3 years ago
7 0

Answer:

a. ArrayList years

Explanation:

Required

Complete the code segment

The programming question is about Java programming language.

In java, the syntax to declare an ArrayList of no specific datatype is:

ArrayList [List-name] = new ArrayList();

From the question, the name of the ArrayList is years.

So, the syntax when implemented is:

<em>ArrayList years = new ArrayList();</em>

<em>So, the comment /*missing code*/ should be replaced with: ArrayList years</em>

You might be interested in
Encapsulate the following Python code from Section 7.5 in a function called my_sqrt that takes a as a parameter, chooses a start
Elden [556K]

Answer:

def my_sqrt(a):

   while True:

       x = a

       y = (x + a / x) / 2

       if (y == x):

           break

       else:

           x = y

   print(x)

   return 0

my_sqrt(5)

Explanation:

The above is a function in Python, and the exact copy as code of what is being given in the question. Its a method to find out the square root of a number which is a here. The while loop has been used as being mentioned in the question, and the variables are defined and calculated as being stated.

3 0
3 years ago
What is an advantage and disadvantage to file compression
Softa [21]
I dont know many but heres a few
Advantage: storage space
disadvantage: possibility of corruption and lost files
7 0
4 years ago
Which key doesn't relate to keyboard
igomit [66]

Answer:

Key to your heart

Explanation:

Chia Chia Chia Chia

8 0
3 years ago
Read 2 more answers
PLS FAST DONT EXPLAIN
Rzqust [24]

Answer:

</head>

Explanation:

8 0
3 years ago
Wish I could give you a 1,000/5
emmainna [20.7K]

Is this a question or you mean you wish you could give people 1,000 points?

7 0
3 years ago
Other questions:
  • Seasons Write a program that takes a date as input and outputs the date's season. The input is a string to represent the month a
    14·1 answer
  • What is the definition of online communication
    15·1 answer
  • Which ipv6 static route would serve as a backup route to a dynamic route learned through ospf?
    12·1 answer
  • What is the name of the malware included in CCleaner?
    13·1 answer
  • Given positive integer num_insects, write a while loop that prints that number doubled up to, but without exceeding 100. Follow
    8·1 answer
  • What is a thesaurus is best used for​
    11·2 answers
  • According to Android’s suggested user interface standards, repeatedly pressing the app icon on an app’s action bar will eventual
    5·2 answers
  • When using ntfs as a file system, what can be used to control the amount of hard disk space each user on the machine can have as
    8·1 answer
  • Which statement best describes the difference between a spreadsheet and a database?
    9·2 answers
  • Select three advantages of cloud computing.
    10·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!