From 1fb857a3b7e443cbfb484465dd37791cd80c88af Mon Sep 17 00:00:00 2001 From: Fabio Scotto di Santolo Date: Sun, 12 Aug 2018 12:18:46 +0200 Subject: [PATCH] test --- .../associate/java8/test/Automobile.java | 29 +++++++++++++++++++ 1 file changed, 29 insertions(+) create mode 100644 src/com/oracle/associate/java8/test/Automobile.java diff --git a/src/com/oracle/associate/java8/test/Automobile.java b/src/com/oracle/associate/java8/test/Automobile.java new file mode 100644 index 0000000..9a6e380 --- /dev/null +++ b/src/com/oracle/associate/java8/test/Automobile.java @@ -0,0 +1,29 @@ +package com.oracle.associate.java8.test; + +public class Automobile { + private static int targaCorrente; + private int targa; + private int portiere; + + //1 + static { + targaCorrente = 0; + System.out.println("Blocco statico"); + } + + //2 + { + this.targa = targaCorrente++; + System.out.println("Blocco istanza"); + } + + //3 + public Automobile(int portiere) { + this.portiere = portiere; + System.out.println("Costruttore"); + } + + public static void main(String[] args) { + new Automobile(5); + } +}