MainClass.java Source code

Java tutorial

Introduction

Here is the source code for MainClass.java

Source

import java.util.LinkedList;

public class MainClass {
    public static void main(String[] a) {
        LinkedList<String> officers = new LinkedList<String>();

        officers.add("B");
        officers.add("B");
        officers.add("T");
        officers.add("H");
        officers.add("P");
        officers.add("McIntyre");
        System.out.println(officers);

        officers.set(2, "Murdock");
        System.out.println("\nTuttle is replaced:");
        System.out.println(officers);
    }
}