Created
February 24, 2021 13:04
-
-
Save SimonHarmonicMinor/0e002a02f2911560498d3868d0ba907f to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class Person { | |
public Person() { | |
System.out.println("I was created"); | |
} | |
@PostConstruct | |
private void init() { | |
System.out.println("I was constructed"); | |
} | |
} | |
@Configuration | |
public class Conf { | |
@Bean | |
public Person person() { | |
return new Person(); | |
} | |
@Bean | |
public Book book() { | |
var oldPerson = person(); | |
System.out.println("oldPerson " + oldPerson); | |
return new Book(); | |
} | |
@Bean | |
public Person person2() { | |
return person(); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment