The Java Program: BadFinal.java

  1 final class Super {
  2 }
  3 
  4 /*  No class can extend "Super"!
  5 class Sub extends Super {
  6 }
  7 */
  8 
  9 class AnotherSuper {
 10    final void m () {}
 11    final int f = 3;
 12 }
 13 
 14 class AnotherSub extends AnotherSuper {
 15    /*  Method "void m ()" can not be overriden!
 16    void m () {}
 17    */
 18    int m (boolean b) { return f; }
 19    int f = 4;
 20 }
 21 
 22 
 23 public class BadFinal {
 24 }