File tree 4 files changed +8
-8
lines changed
bin/com/gnguyen92/springdemoannotations
src/com/gnguyen92/springdemoannotations
4 files changed +8
-8
lines changed Original file line number Diff line number Diff line change @@ -9,18 +9,18 @@ public class JavaConfigDemo {
9
9
public static void main (String [] args ) {
10
10
11
11
// load spring config java class
12
- AnnotationConfigApplicationContext context = new AnnotationConfigApplicationContext (" ValuesConfig.class" );
12
+ AnnotationConfigApplicationContext context = new AnnotationConfigApplicationContext (ValuesConfig .class );
13
13
14
14
// retreive the bean
15
- // Coach myCoach = context.getBean("gymnasticsCoach", Coach.class);
15
+ Coach myCoach = context .getBean ("gymnasticsCoach" , Coach .class );
16
16
WrestlingCoach myCoach2 = context .getBean ("wrestlingCoach" , WrestlingCoach .class );
17
17
18
18
// call methods on the bean
19
- // System.out.println("\nGym: ");
20
- // System.out.println(myCoach.getDailyWorkout());
21
- //
22
- // // call method to get current skill level
23
- // System.out.println(myCoach.getSkillLevel());
19
+ System .out .println ("\n Gym: " );
20
+ System .out .println (myCoach .getDailyWorkout ());
21
+
22
+ // call method to get current skill level
23
+ System .out .println (myCoach .getSkillLevel ());
24
24
25
25
System .out .println ("\n Wrestling: " );
26
26
System .out .println (myCoach2 .getDailyWorkout ());
Original file line number Diff line number Diff line change 15
15
// Add @Configuration annotation to tell Java this is a config file
16
16
// Add @ComponentScan("package to scan")
17
17
@ Configuration
18
- // @ComponentScan("com.gnguyen92.springdemoannotations")
18
+ @ ComponentScan ("com.gnguyen92.springdemoannotations" )
19
19
public class ValuesConfig {
20
20
21
21
// @Bean method definition ******************************
You can’t perform that action at this time.
0 commit comments