13.07.2015 Views

Spring Core Certification 3 Mock Exam - Java & Moi

Spring Core Certification 3 Mock Exam - Java & Moi

Spring Core Certification 3 Mock Exam - Java & Moi

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

Question 8Select the right statement about referring a <strong>Spring</strong> configuration file inside the packagecom.example.myapp in the below example?ApplicationContext context = newClassPathXmlApplicationContext("classpath:/com.example.myapp.config.xml");1. The classpath: prefix could be omit2. Package name with dot is not well formatted using the dot character3. The slash character preceding com.example could be omit4. All of the above5. None of the aboveQuestion 9How to auto-inject into a field a bean by its name? Select one or more response.1. With the name attribute of the @Autowired annotation2. By using the single @Qualifier annotation3. By using both the @Autowired and the @Qualifier spring annotations4. By using the @Autowired annotation and naming the field with the bean nameQuestion 10What are the main advantages of using interfaces when designing business services? Select one ormore answers.1. <strong>Mock</strong>ing or stubbing the service2. Be able to use the <strong>Spring</strong> auto-injection3. Can do dependency checking4. Loosely coupled codeQuestion 11Select one or many correct answers about spring bean life cycle.1. The method annoted with @PostConstruct is called after bean instantiation and beforeproperties setting of the bean2. The method @PreDestroy of a prototype bean is called when the bean is garbage collected3. The init() method declared in the init-method attribute of a bean is called before theafterPropertiesSet callback method of the InitializingBean interface4. The method annotated with @PostConstruct is called before before the afterPropertiesSetcallback method of the InitializingBean interfaceQuestion 12Given the following configuration class, what are correct affirmations? Select one or more answers.

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!