1 package com.wpollock.manualdidemo;
2
3
4
5
6
7
8
9
10 public class Main {
11 public static void main (String [] args) {
12 try {
13 PropInjectedController pic = new PropInjectedController();
14 pic.sayHello();
15 }
16 catch (NullPointerException npe) {
17 System.out.println("PropInjectedController sayHello threw NPE");
18 }
19
20 try {
21 SetterInjectedController sic = new SetterInjectedController();
22 sic.sayHello();
23 }
24
25 catch (NullPointerException npe) {
26 System.out.println("SetterInjectedController sayHello threw NPE");
27 }
28
29 try {
30 ConstructorInjectedController cic = new ConstructorInjectedController(null);
31 cic.sayHello();
32 }
33 catch (NullPointerException npe) {
34 System.out.println("ConstructorInjectedController sayHello threw NPE");
35 }
36
37 }
38 }