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
kvasek [131]
3 years ago
9

Consider the following statement, which is intended to create an ArrayList named a to store only elements of type Thing. Assume

that the Thing class has been properly defined and includes a no-parameter constructor.
ArrayList a = /* missing code */;
Which of the following can be used to replace /* missing code */ so that the statement works as intended?
A: new Thing()
B: new ArrayList()
C: new ArrayList(Thing)
D: new ArrayList()
E: new ArrayList<>(Thing)
Engineering
1 answer:
MrMuchimi3 years ago
3 0

Answer:

new ArrayList<Thing>()

Explanation:

The syntax to declare an arrayList is:

ArrayList [var-name] = new ArrayList<data-type>()

From the question;

We understand that the variable name is: a

And the data-type is: Thing

So, the ArrayList of type Thing can be defined using:

ArrayList a = new ArrayList<Thing>();

Hence:

None of the options answers the question.

You might be interested in
Select three types of lines that engineers use to help represent the shape of a design in a sketch.
Vikki [24]

Hidden lines

  • Used to describe the in shown lines (like diagonals inside cubes)

Extension lines:-

  • Used to explain the expansion of structures like building

Object lines

  • Used to describe the structure of objects and the lining to show borders
7 0
2 years ago
Fix the code so the program will run correctly for MAXCHEESE values of 0 to 20 (inclusive). Note that the value of MAXCHEESE is
GarryVolchara [31]

Answer:

Code fixed below using Java

Explanation:

<u>Error.java </u>

import java.util.Random;

public class Error {

   public static void main(String[] args) {

       final int MAXCHEESE = 10;

       String[] names = new String[MAXCHEESE];

       double[] prices = new double[MAXCHEESE];

       double[] amounts = new double[MAXCHEESE];

       // Three Special Cheeses

       names[0] = "Humboldt Fog";

       prices[0] = 25.00;

       names[1] = "Red Hawk";

       prices[1] = 40.50;

       names[2] = "Teleme";

       prices[2] = 17.25;

       System.out.println("We sell " + MAXCHEESE + " kind of Cheese:");

       System.out.println(names[0] + ": $" + prices[0] + " per pound");

       System.out.println(names[1] + ": $" + prices[1] + " per pound");

       System.out.println(names[2] + ": $" + prices[2] + " per pound");

       Random ranGen = new Random(100);

       // error at initialising i

       // i should be from 0 to MAXCHEESE value

       for (int i = 0; i < MAXCHEESE; i++) {

           names[i] = "Cheese Type " + (char) ('A' + i);

           prices[i] = ranGen.nextInt(1000) / 100.0;

           amounts[i] = 0;

           System.out.println(names[i] + ": $" + prices[i] + " per pound");

       }        

   }

}

7 0
4 years ago
Scientific research techniques are used to analyze the effectiveness of political advertising. False True
miv72 [106K]

Answer:

correct me if i'm wrong but i think it's false

Explanation:

5 0
3 years ago
Give me top 5 British snacks
tia_tia [17]

Answer:

1. Mini Cheddars

2. Sausage Roll

3. Monster Munch

4. Cheese Twists

5. Flapjacks

6 0
2 years ago
A consolidation test was performed on a sample of fine-grained soil sample taken from a depth such that the vertical effective s
Scorpion4ik [409]

Answer:

The settlement that is expected is 1.043 meters.

Explanation:

Since the pre-consolidation stress of the layer is equal to the effective stress hence we conclude that the soil is normally consolidated soil

The settlement due to increase in the effective stress of a normally consolidated soil mass is given by the formula

\Delta H=\frac{H_oC_c}{1+e_o}log(\frac{\bar{\sigma_o}+\Delta \bar{\sigma }}{\bar{\sigma_o}})

where

'H' is the initial depth of the layer

C_c is the Compression index

e_o is the inital void ratio

\bar{\sigma_o} is the initial effective stress at the depth

\Delta \bar{\sigma_o} is the change in the effective stress at the given depth

Applying the given values we get

\Delta H=\frac{8\times 0.3}{1+0.87}log(\frac{154+28}{154})=1.04

3 0
3 years ago
Other questions:
  • Define the difference between elastic and plastic deformation in terms of the effect on the crystal lattice structure.
    5·1 answer
  • A 16-lb solid square wooden panel is suspended from a pin support at A and is initially at rest. A 4-lb metal sphere is shot at
    8·1 answer
  • IN JAVA,
    6·1 answer
  • You could be sued if you injure someone while rescuing them if...
    11·2 answers
  • Name the famous engineer in the world​
    10·2 answers
  • Pleae answer brainlest due today
    6·2 answers
  • A spherical metal ball of radius r_0 is heated in an oven to a temperature of T_1 throughout and is then taken out of the oven a
    6·1 answer
  • A coil having a resistance of 10 ohms and an inductance of 4 H is switched across a 20W dc source. Calculate (a) time required b
    9·1 answer
  • What energy does a curcuit board run on
    11·2 answers
  • Which organization would provide business and leadership training to a high school hospitality student?
    6·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!