java final method

https://w‮l.ww‬autturi.com
java final method

When a METHOD is declared with final keyword, it is called a final method.
A final method cannot be OVERRIDEN.

public class Counter {
    private int counter = 0;

    public final int count() {
        return counter++;
    }

    public final int reset() {
        return (counter = 0);
    }
}
Created Time:2017-09-05 15:20:44  Author:lautturi