Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package io.github.tdudzik.testproject;
- class A {
- A() {
- System.out.println("A created.");
- }
- }
- class B {
- B() {
- System.out.println("B created.");
- }
- }
- class C {
- private final static A a = new A();
- C() {
- new B();
- }
- }
- public class TestProjectApp {
- public static void main(String[] args) {
- for (int i = 0; i < 10; i++) {
- new C();
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment