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
zimovet [89]
3 years ago
9

Assume that you have an ArrayList variable named a containing 4 elements, and an object named element that is the correct type t

o be stored in the ArrayList.
Which of these statements adds the object to the end of the collection?1. a[3] = element;
2. a.add(element;
3. a[4] = element;
4. a.add(element);
Computers and Technology
1 answer:
jonny [76]3 years ago
7 0

Answer:

Option (4) is the correct answer.

Explanation:

In Java programming language ,array collection starts from 0 index location and ends in a size-1 index location. So to access the last elements the user needs to use a[Size-1] statement. so to modify the value of the last location of the array the user needs to use "a[size-1]= element;".

But when the user wants to add some new value to the end of the array list collection then he needs to use the statement--

a.add(element); //where add is a function, element is a value and a is a array list object.

Another option is invalid because--

  • Option 1 is not the correct because "a[3]=element;" modify the value of the 3rd element of the array.
  • Option 2 gives a compile-time error because add functions bracts are not closed.
  • Option 3 gives the error because a[4] gives the location of the 5th element of the array but the above question says that a is defined with 4 elements.
You might be interested in
Discard an old computer and want to erase my files
Tamiku [17]
You can use a program like SafeErase to wipe all of your data throughly off your computer. 
7 0
3 years ago
Illustrate how information technology helps organizations to cut costs by reducing switching costs and increasing competitivenes
Ulleksa [173]

Information technology is the method of choosing the best technology for working with data.

With this definition, it can be said that information technology has existed since man began to store data. Today, however, it mainly refers to electronic communication and storage of data, for which computers and other electronic equipment are used.

Information technologies are of vital importance in the functioning of business operations today, as they allow a better and more optimal organization of resources and information of companies.

Thus, companies organize their information via digital methods, make online sales, etc.

Learn more in brainly.com/question/7091883

6 0
2 years ago
Suppose that the new WLAN will also provide roaming services for employees who must use portable computers and tablets in may wa
lozanna [386]

The wireless topology that would be the best choice will be the Extended Services Set (ESS)

Explanation:

There are two types of service sets that are used to provide connection to the computers and they function with the access points they are the basic service sets and the extended services set

Extended services set are use to establish connections across mote than two Access Points and this type of connection is used because this can provide data in the roaming conditions

Topology refers to the way in which the systems are interconnected and there are different types of topology like the star, mesh and bus.

3 0
3 years ago
Which file format is an audio file format?
Nitella [24]

Answer:

D. WMA

Explanation:

Windows media file

7 0
3 years ago
When you format text, what are you doing?
vova2212 [387]

Answer:

d

Explanation:

7 0
3 years ago
Read 2 more answers
Other questions:
  • Write a fragment of code that reads in strings from standard input, until end-of-file and prints to standard output the largest
    10·1 answer
  • What websites can help you learn about general career treads
    11·1 answer
  • What does the domain in an email message mean?
    8·1 answer
  • Using Task Manager, you discover an unwanted program that is launched at startup.
    13·1 answer
  • A plan to budget time for studying and activities is referred to as
    15·1 answer
  • When tcp/ip was developed, the host table concept was expanded into a hierarchical name system for matching computer names and n
    5·1 answer
  • What is an ISP?<br> in computer Networking
    11·2 answers
  • When you are working in Performance Monitor, in the "Add Counters" dialog box, and need more information about a particular coun
    8·1 answer
  • Microsoft's ____ is one of the major web-based development environments.
    12·1 answer
  • Que significa el término Informática?
    6·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!