All Downloads are FREE. Search and download functionalities are using the official Maven repository.

edu.pdx.cs410J.tips.Truth Maven / Gradle / Ivy

The newest version!
package edu.pdx.cs410J.tips;

/**
 * This class demonstrates some interesting things about static
 * initializers. 
 */
public class Truth {
  public static void main(String args[]) {
    new Foo();
  }
}

class Foo {
  static Bar b = new Bar();

  static boolean truth() { return true; }
  static final boolean TRUTH = truth();

  Foo() {
    System.out.println("The truth is: " + TRUTH);
  }
}

class Bar extends Foo { } 




© 2015 - 2024 Weber Informatics LLC | Privacy Policy