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
Nadya [2.5K]
3 years ago
15

Consider the following code segment: ArrayList bulbs = new ArrayList(); bulbs.add(new Light()); bulbs.remove(0); bulbs.add(new L

ight()); Light b = new Light(); bulbs.add(1, b); bulbs.add(new Light()); bulbs.remove(0); bulbs.add(new Light()); bulbs.remove(2); bulbs.add(new Light()); bulbs.add(1, new Light()); After running the code, what is the size of bulbs?
Computers and Technology
2 answers:
mezya [45]3 years ago
6 0

Answer:

4

Explanation:

ArrayList bulbs = new ArrayList();

bulbs.add(new Light()); // bulbs array length equal to 1

bulbs.remove(0); // bulbs array length equal to 0

bulbs.add(new Light()); // bulbs array length equal to 1

Light b = new Light();

bulbs.add(1, b); // bulbs array length equal to 2

bulbs.add(new Light()); // bulbs array length equal to 3

bulbs.remove(0); // bulbs array length equal to 2

bulbs.add(new Light()); // bulbs array length equal to 3

bulbs.remove(2); // bulbs array length equal to 2

bulbs.add(new Light()); // bulbs array length equal to 3

bulbs.add(1, new Light()); // bulbs array length equal to 4

Scrat [10]3 years ago
4 0
To answer this, lets run through the code:

<span>ArrayList bulbs = new ArrayList(); //create a new empty list

bulbs.add(new Light()); //size of bulbs  = 1

bulbs.remove(0); //remove item at index 0. size of bulbs = 0

bulbs.add(new Light()); // size of bulbs = 1

Light b = new Light();
bulbs.add(1, b); // size of bulbs = 2

bulbs.add(new Light()); //size of bulbs = 3

bulbs.remove(0); //remove bulb at index 0. Size of bulbs = 2

bulbs.add(new Light()); size of bulbs = 3

bulbs.remove(2); //remove bulb at index 2. size of bulbs = 2

bulbs.add(new Light()); //size of bulbs = 3

bulbs.add(1, new Light()); //inserted at position 1. size of bulbs = 4

The final answer. Size of bulbs = 4.</span>
You might be interested in
How does the luminosity of this star compare with that of the other three (hip 87937, hip 108870, and tau cet)?
Afina-wow [57]

Answer:

Regulus is the most luminous. Regulus is the least luminous

Explanation:

  • Transcribed image text: Of the three stars you've observed (HIP 87937, HIP 108870, and Tau Cet), which one is more luminous?
  • View Available Hint(s) Tau Cet O HIP 87937 O HIP 108870
  • They have the same luminosity.

To learn more about it, refer

to https://brainly.in/question/413163

#SPJ4

6 0
2 years ago
Acme Widgets currently uses a 1024-bit RSA encryption standard company wide. The company plans to convert from RSA to an ellipti
nadya68 [22]

Answer:

The answer is "Option A".

Explanation:

The elliptical curve cryptography system needs much shorter keys for cryptography, and it is very powerful because of the RSA cryptography method. It is also known as a key of 1024-bit, which is in comparison is equal to the 160-bit ECC key for cryptographic, that's why other options are not correct, which is defined as follows:

  • In option B,  It is higher the ECC key system, that's why it's wrong.
  • In option C, It is a part of the RSA system but its value doesn't match the ECC system, that's why it is wrong.  
  • In option D, It's valued is just double to the RSA system, that's why it is wrong.

6 0
3 years ago
Which form of data does the image represent? (10 points)<br> A. Analog data<br> B. Digital data
EastWind [94]
The image in the photograph is representing A. Analog Data. Analog data is data that is represented in a physical way. Where digital data is a set of individual symbols, analog data is stored in physical media, whether that's the surface grooves on a vinyl record, the magnetic tape of a VCR cassette, or other non-digital media. Analog and digital signals are different types which are mainly used to carry the data from one apparatus to another. Analog signals are continuous wave signals that change with time period whereas digital is a discrete signal is a nature. Examples of analog technology: photocopiers. old land-line telephones. audio tapes. old televisions (intensity and color information per scan line). Analog and digital signals are the types of signals carrying information. The major difference between both signals is that the analog signals that have continuous electrical signals, while digital signals have non-continuous electrical signals.
8 0
3 years ago
Products in which titanium is used
Lynna [10]

Answer:

It is used in jewelry, tennis rackets, scissors, bicycle frames, surgical tools, mobile phones and some other high-performance products.

Explanation:

Titanium is a familiar metal. Titanium is as strong as steel but weights about half as much.

6 0
3 years ago
Read 2 more answers
Which web design concept is most closely related to elements that symbolize the real world? A. node B. landmark c.metaphor IN D.
sergij07 [2.7K]

Answer:

landmark

Explanation:

6 0
3 years ago
Other questions:
  • what is the primary way to access applications in windows 8? a. control panel b. start menu c. desktop tiles d. context menu
    7·1 answer
  • An is auditor reviewing a network log discovers that an employee ran elevated commands on his/her pc by invoking the task schedu
    10·1 answer
  • Write a few statements that open a file called "greeting", write the message "hey!" to the file -- and then close it. declare an
    13·2 answers
  • How do you find the exterior angle measure of any regular polygon? (The degree in which to turn the turtle to draw a shape)
    10·1 answer
  • Mathematical expression that might link numbers in cells
    14·1 answer
  • In 2009, __________ accounted for 1,772 total fatalities. A. passengers riding with impaired drivers B. children hit by backing
    14·2 answers
  • The File method lastModified() returns
    10·1 answer
  • Write a Java program to create a class called Cars. The class should include three instance variables: makes (type: String), mod
    12·1 answer
  • Could u give me brief summary of New Years
    14·2 answers
  • Overview In this project you need to design and implement an Emergency Room Patients Healthcare Management System (ERPHMS) that
    14·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!