Java: Rätsel des Tages

Erstellt am 30. April 2019 von It_berater

Was ist das Ergebnis?

/**
 * Rätsel des Tages.
 * 
 * @author Thomas Wenzlaff
 *
 */
final public class RätselDerWoche {

	private static int x = 1;

	static {
		x++;
	}

	public static void main(String[] args) {
		System.out.println("Ergebnis: " + x);
	}

	static {
		x = 3;
	}
}

Ergebnis: 3

Ähnliche Artikel:

  1. Java Rätsel des Monats
  2. Java Quiz
  3. Java 7 ist DA!