Question

Consider the ArrayList and LinkedList classes of the standard library. What abstract class do they extend?...

Consider the ArrayList and LinkedList classes of the standard library.

What abstract class do they extend?

What interface types does that abstract class implement? Draw a class diagram

Homework Answers

Answer #1

Both ArrayList and LinkedList are two variants of List which is a dynamic collection of objects.

Both ArrayList and LinkedList extends from the parent class AbstractList<E>

The syntax is

public class ArrayList<E>
   extends AbstractList<E>
   implements List<E>, RandomAccess, Cloneable, Serializable

Here E represents the type of the element to be added in the list.

They implements the the interface called List<E> so that both of ArrayList and LinkedList can use the functions and properties of the List<E> inteface.

Know the answer?
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for?
Ask your own homework help question
Similar Questions
Consider the HashSet and TreeSet classes of the standard library. What abstract class do they extend?...
Consider the HashSet and TreeSet classes of the standard library. What abstract class do they extend? What interface types does that abstract class implement? Draw a class diagram
Calculating the mean and standard deviation for two classes the results were as follows. For class...
Calculating the mean and standard deviation for two classes the results were as follows. For class one the mean is 17.1 and the SD is 9.814. For class 2 the mean is 20.6 and the SD is 8.64. What do these results tell us?
Language is C# 1. Create the following classes: Vessel, which is an abstract class and represents...
Language is C# 1. Create the following classes: Vessel, which is an abstract class and represents any water-going craft. Ship, which is a Vessel. Fun Fact: A Ship is any vessel that is large enough to carry smaller Boats. Boat, which is a Vessel. and Cat, which is just a cat. All Vessels should have a float speed; and string name; Ships should have an int fuel and an int maxFuel. Boats should have an int oars; Cats should have...
There are 2 classes. Afternoon class with mean = 70 and standard deviation is 15 Morning...
There are 2 classes. Afternoon class with mean = 70 and standard deviation is 15 Morning class with a mean = 70 and standard deviation of 5. The spread of grades in the morning class has less variation and located mostly around the mean.   According to emperical rule (assuming grades are normally distributed) it says, 68% of grades are falls within 1 standard deviation, 95% of grades falls within 2 standard deviation and 99.7% of grades falls within 3 standard...
Goal:   Manage the inventory of objects sold in an online or brick and mortar store. If...
Goal:   Manage the inventory of objects sold in an online or brick and mortar store. If you can't implement all of the features of Project described in this document, implement what you can. Start by implementing the StockItem class, and its derived classes. Then add in the InventoryManager class later. In each case, the test files must be in separate classes. UML Diagram: Use Violet or other drawing software to draw the UML diagrams of each class that you use...
1- Use inheritance to implement the following classes: A: A Car that is a Vehicle and...
1- Use inheritance to implement the following classes: A: A Car that is a Vehicle and has a name, a max_speed value and an instance variable called the number_of_cylinders in its engine. Add public methods to set and get the values of these variables. When a car is printed (using the toString method), its name, max_speed and number_of_cylinders are shown. B: An Airplane that is also a vehicle and has a name, a max_speed value and an instance variable called...
Consider the following description below: In a company, each employee belongs to one department. One of...
Consider the following description below: In a company, each employee belongs to one department. One of the employees of a department is the Head of Department. Each department occupies one or more offices. An office can be occupied by no department or by one department. An employee is identified by an id and has a name. A department is identified by its name. An office is identified by its office number. Draw a class diagram for the above scenario to...
1.What is the difference between class/object? 2.Did you think about classes/objects around you since the last...
1.What is the difference between class/object? 2.Did you think about classes/objects around you since the last session? 3.What library do we need for processing file I/O? 4.What is the class for the input file stream? Give an example 5.What is the class for the output file stream? Give an example 6.Why do you want to use files instead of using input? 7.How do you read from a file? give an example 8.How do you write to a file? give an...
Consider the following incomplete declaration of a Name class for 2a-2c. public class Name something missing...
Consider the following incomplete declaration of a Name class for 2a-2c. public class Name something missing {    private String first;    private String last;    public Name(String firstName, String lastName)    { first = firstName; last = lastName;    }    //additional methods } 2a) In the first two parts, you will modify the Name class so that it implements the Comparable interface. Show here what should go in place of something missing in the first line of the...
6) Consider the following class descriptions for objects in a video game: An NPC (non-player character)...
6) Consider the following class descriptions for objects in a video game: An NPC (non-player character) in a video game has some basic data that belongs to all entities in a game. All NPCs have a name, which is a String, health, which is an integer, and a description, which is a String. NPCs have accessor methods for each of their instance variables. NPCs also have an act() method, which is void; however, since there are no true NPCs in...
ADVERTISEMENT
Need Online Homework Help?

Get Answers For Free
Most questions answered within 1 hours.

Ask a Question
ADVERTISEMENT