Bean exception

Report a typo

Which exception might be triggered in this code if you try to inject a Car bean without matching it with the name?

@Configuration
public class Config {

    @Bean
    public Car teslaCar() {
        return new Car("Tesla", "2023");
    }

    @Bean
    public Car toyotaCar() {
        return new Car("Toyota", "2023");
    }
}
Select one option from the list
___

Create a free account to access the full topic