Main.java Source code

Java tutorial

Introduction

Here is the source code for Main.java

Source

import java.util.Collections;
import java.util.LinkedList;
import java.util.List;

public class Main {
    public static void main(String[] args) {
        List<Integer> list = new LinkedList<Integer>();
        list.add(1);
        List<Integer> unmodifiableList = Collections.unmodifiableList(list);
        System.out.println(unmodifiableList.getClass());
        if (unmodifiableList.getClass().getName().contains("UnmodifiableList"))
            System.out.println(true);
    }
}