logo

Crowdly

Browser

Add to Chrome

Was wird ausgegeben, wenn man die Anwendung startet: [EK] @Scope ( "prototype...

✅ The verified answer to this question is available below. Our community-reviewed solutions help you understand the material better.

Was wird ausgegeben, wenn man die Anwendung startet: [EK]

@Scope("prototype"

)

@Component

public class GreeterPrototype

{

private static int lastId = 0

;

private final int id = ++lastId

;

@Override

public String toString

() {

return "GreeterPrototype " + id

;

}

}

@Component

public class ProfileTester implements CommandLineRunner

{

@Autowired

private GreeterPrototype greeterPrototype

;

@Autowired

private ApplicationContext context

;

@Override

public void run(String... args) throws Exception

{

System.out.println(greeterPrototype + "\n" + context.getBean(GreeterPrototype.class

));

}

}

0%
0%
0%
More questions like this

Want instant access to all verified answers on elearning.tgm.ac.at?

Get Unlimited Answers To Exam Questions - Install Crowdly Extension Now!

Browser

Add to Chrome