Last active
July 6, 2018 07:27
-
-
Save indzi/742e5a33e5eb74366445a85610564d03 to your computer and use it in GitHub Desktop.
List of common spring annotations
This file contains hidden or 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
//Annotation to declare a class as a spring Bean | |
@Component | |
class Bean{ | |
public String printDate(){ | |
return "Now it is: "+LocalDateTime.now(); | |
} | |
@PostConstruct | |
public void post(){ | |
System.out.println("Output: "printDate()); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment