Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public class DependencyInjectionWithSpring {
- private WeatherService weatherService = new WeatherService();
- public void run() {
- weatherService.printWeather();
- }
- }
- public class WeatherService {
- public void printWeather() {
- System.out.println("The weather is sunny with a 20% chance of rain");
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement