List.java Source code

Java tutorial

Introduction

Here is the source code for List.java

Source

import java.io.FileOutputStream;
import java.util.Map;
import java.util.Properties;
import java.util.TreeMap;

public class List {
    public static void main(String args[]) throws Exception {
        Properties p = System.getProperties();
        p.list(System.out);
        FileOutputStream fos = new FileOutputStream("sys.out");
        p.store(fos, null);
        fos.close();
        Map map = new TreeMap(p);
        System.out.println(map);
    }
}