Skip to content

Commit 7f93b1a

Browse files
committed
FIX BUG: syntax when referencing ValuesConfig.java class
1 parent b2821ff commit 7f93b1a

File tree

4 files changed

+8
-8
lines changed

4 files changed

+8
-8
lines changed
Binary file not shown.
Binary file not shown.

src/com/gnguyen92/springdemoannotations/JavaConfigDemo.java

+7-7
Original file line numberDiff line numberDiff line change
@@ -9,18 +9,18 @@ public class JavaConfigDemo {
99
public static void main(String[] args) {
1010

1111
// load spring config java class
12-
AnnotationConfigApplicationContext context = new AnnotationConfigApplicationContext("ValuesConfig.class");
12+
AnnotationConfigApplicationContext context = new AnnotationConfigApplicationContext(ValuesConfig.class);
1313

1414
// retreive the bean
15-
//Coach myCoach = context.getBean("gymnasticsCoach", Coach.class);
15+
Coach myCoach = context.getBean("gymnasticsCoach", Coach.class);
1616
WrestlingCoach myCoach2 = context.getBean("wrestlingCoach", WrestlingCoach.class);
1717

1818
// 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("\nGym: ");
20+
System.out.println(myCoach.getDailyWorkout());
21+
22+
// call method to get current skill level
23+
System.out.println(myCoach.getSkillLevel());
2424

2525
System.out.println("\nWrestling: ");
2626
System.out.println(myCoach2.getDailyWorkout());

src/com/gnguyen92/springdemoannotations/ValuesConfig.java

+1-1
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
// Add @Configuration annotation to tell Java this is a config file
1616
// Add @ComponentScan("package to scan")
1717
@Configuration
18-
//@ComponentScan("com.gnguyen92.springdemoannotations")
18+
@ComponentScan("com.gnguyen92.springdemoannotations")
1919
public class ValuesConfig {
2020

2121
// @Bean method definition ******************************

0 commit comments

Comments
 (0)