Loading

Quipoin Menu

Learn • Practice • Grow

spring / Property Placeholder & Profiles
mcq
Direction: Choose the correct option

Q1.

What is the purpose of PropertyPlaceholderConfigurer?
A. To resolve ${...} placeholders in bean definitions
B. To load properties files
C. To configure profiles
D. Both A and B
Direction: Choose the correct option

Q2.

Which annotation is used to load properties files in Spring?
A. @PropertySource
B. @PropertySources
C. @ConfigurationProperties
D. @Value
Direction: Choose the correct option

Q3.

How do you inject a property value into a field?
A. @Value('${property.name}')
B. @Property('property.name')
C. @InjectProperty
D. @PropertySource
Direction: Choose the correct option

Q4.

What is a Spring profile?
A. A way to group beans and configurations for specific environments
B. A user profile
C. A security role
D. A logging level
Direction: Choose the correct option

Q5.

How do you mark a bean to be available only in a specific profile?
A. @Profile('dev')
B. @ActiveProfile('dev')
C. @ProfileName('dev')
D. @ForProfile('dev')
Direction: Choose the correct option

Q6.

Which interface can be used to programmatically check active profiles?
A. Environment
B. Profiles
C. ActiveProfiles
D. ProfileChecker
Direction: Choose the correct option

Q7.

What is the modern replacement for PropertyPlaceholderConfigurer?
A. PropertySourcesPlaceholderConfigurer
B. ContextPlaceholderConfigurer
C. PlaceholderResolver
D. PropertyManager
Direction: Choose the correct option

Q8.

How can you set active profiles in a Spring Boot application?
A. In application.properties: spring.profiles.active=dev
B. As command line argument: --spring.profiles.active=dev
C. As system property: -Dspring.profiles.active=dev
D. All of the above
Direction: Choose the correct option

Q9.

What is the use of profile-specific properties files?
A. application-dev.properties for dev profile
B. application-prod.properties for prod profile
C. Both A and B
D. None
Direction: Choose the correct option

Q10.

What happens if no profile is active?
A. Beans without @Profile are loaded
B. No beans are loaded
C. Default profile is 'default'
D. Both A and C