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
Luba_88 [7]
3 years ago
14

A teacher wants to create a list of students in her class. Using the existing Student class in this exercise. Create a static Ar

rayList called classList that adds a student to the classList whenever a new Student is created. In the constructor, you will have to add that Student to the ArrayList.

Computers and Technology
1 answer:
aleksandr82 [10.1K]3 years ago
4 0

Answer:

Check the explanation

Explanation:

CODE:-

import java.util.ArrayList;

class Student

{

  private String name;

  private int grade;

  private static ArrayList<Student> classList = new ArrayList<Student>();

 

  public Student(String name, int grade)

  {

      this.name = name;

      this.grade = grade;

      classList.add(this);

  }

 

  public String getName()

  {

      return this.name;

  }

 

  /*Don't change the code in this method!

  This method will print out all the Student names in the classList Array

  */

  public static String printClassList()

  {

      String names = "";

      for(Student name: classList)

      {

          names+= name.getName() + "\n";

      }

      return "Student Class List:\n" + names;

  }

}

public class ClassListTester

{

  public static void main(String[] args)

  {

      //You don't need to change anything here, but feel free to add more Students!

      Student alan = new Student("Alan", 11);

      Student kevin = new Student("Kevin", 10);

      Student annie = new Student("Annie", 12);

      Student smith = new Student("Smith", 11);

      Student kane = new Student("Kane", 10);

      Student virat = new Student("Virat", 12);

      Student abd = new Student("ABD", 12);

      Student root = new Student("Root", 12);

      System.out.println(Student.printClassList());

  }

}

Kindly check the attached image below.

You might be interested in
A _____ miniature battery operated transmitter that can be propelled through a non-metallic pipe or purpose of locating
Anna11 [10]
I think it is the model ET-2. Not quite sure.
7 0
2 years ago
Maia is typing her report on meerkats for her biology class.
dem82 [27]

Answer:

         

Explanation:

4 0
2 years ago
How is information sent across the internet binary
Annette [7]

Answer:

Binary information must be encoded in some way before transmission over the Internet. ... Copper wire is used to transmit binary messages using electricity - a voltage on the wire means one state, and no voltage means the other. Fiber-optic cables, on the other hand, use light (on or off) to transmit a binary message.

8 0
2 years ago
Which type of computer are todays most widely used personal computers?
iris [78.8K]

Answer:

Windows 10. :)

Explanation:

8 0
3 years ago
Read 2 more answers
1. A formula =A1+B2 is in cell D8. If you copy that formula to cell D9, what is the new formula in cell D9?
MaRussiya [10]
1. Answer is B   (D9=<span>A2+B3)
2. </span><span>C. identifies how many cells with data were in the range 
3. </span><span>A. ascending (smallest to largest)
</span><span>4. A. the current worksheet </span>
6 0
2 years ago
Other questions:
  • Why do computers need to periodically check the dns for websites you have already visited? enter your answer here?
    15·1 answer
  • You would like to create a graph that shows how much of your total investments are in stocks, savings, and mutual funds. You sho
    5·2 answers
  • Ill give you brainiest.
    9·1 answer
  • What data discovery process, whereby objects are categorized into predetermined groups, is used in text mining?
    12·1 answer
  • What is the name of the most expensive car and how much is it and what are its features
    15·1 answer
  • Where is the typical location of a touchpad inside of a laptop?
    13·1 answer
  • A project manager is responsible for (check all that apply)
    13·1 answer
  • Difference between ancient and modern mode of information <br> transmission
    12·1 answer
  • What is Automation ? Please give an example ?
    14·1 answer
  • Have y’all beat shinobi 3 return of The ninja Master for The sega genesis
    5·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!