I have to use mutators in student class. Create a class named Student that includes String data fields for firstName and lastName. Create a constructor that requires two String parameters to populate the firstName and lastName fields. Create a LinkedList of 20 Student objects each having different first and last names. Print your LinkedList, first in the order your items were placed onto the LinkedList and then in reverse order. Save your files as Student.java and ClassRoster.java. Compile and run your programs until it works and the output looks nice. Add the necessary documentation as described in Course Documents, and then attach your .java files to this assignment.
Explanation / Answer
import java.util.*; public class Student { public static void main(String[] args) { System.out.print("What's unchecked folks?"); } public void studentList() { List firstName = new LinkedList (); List lastName = new LinkedList (); firstName.add("Bill"); lastName.add("Stevenson"); firstName.add("Clara"); lastName.add("Yim"); firstName.add("James"); lastName.add("Lane"); firstName.add("Glenn"); lastName.add("Gordon"); firstName.add("Elias"); lastName.add("Martinez"); firstName.add("Ryan"); lastName.add("Beasley"); firstName.add("Janet"); lastName.add("Paul"); firstName.add("Alfredo"); lastName.add("Williams"); firstName.add("Doug"); lastName.add("Thomas"); firstName.add("Carmen"); lastName.add("Sieben"); firstName.add("Aaron"); lastName.add("Musselman"); firstName.add("Charity"); lastName.add("Velasquez"); firstName.add("Doug"); lastName.add("Calhoun"); firstName.add("Joseph"); lastName.add("Martin"); firstName.add("Joshua"); lastName.add("Orenstein"); firstName.add("Lisa"); lastName.add("Edwards"); firstName.add("Vincent"); lastName.add("Parker"); firstName.add("Leroy"); lastName.add("Smith"); firstName.add("Meridith"); lastName.add("Healy"); firstName.add("Ernestine"); lastName.add("Hemphill"); } }