Tutorial.java Source code

Java tutorial

Introduction

Here is the source code for Tutorial.java

Source

enum Tutorial {
    CSS(400), HTML(250);

    int price;

    Tutorial(int p) {
        price = p;
    }

    int showPrice() {
        return price;
    }
}

public class Main {

    public static void main(String args[]) {

        Main t = new Main() {
            protected final Object clone() throws CloneNotSupportedException {
                throw new CloneNotSupportedException();
            }
        };

        for (Tutorial m : Tutorial.values()) {
            System.out.println(m + " costs " + m.showPrice() + " dollars");
        }
    }
}