java class constructor method name start with capital code example

Example 1: how to create an abstract method in java

abstract class Scratch{
  // cannot be static
    abstract public void hello();
    abstract String randNum();
}

interface Other{
  //all methods in an interface are abstract
    public void bye();
    String randDouble();
}

Example 2: stackoverflow java enum with constructor

public enum Day {

    SUNDAY(), MONDAY, TUESDAY(2), WEDNESDAY, THURSDAY, FRIDAY, SATURDAY;

    int value;

    private Day(int value) {
        System.out.println("arg cons");
        this.value = value;
    }

    private Day() {
        System.out.println("no arg cons");
    }

    public static void main(String args[]) {

    }

}