Looking for SEW8b 4xHIT Spring Boot test answers and solutions? Browse our comprehensive collection of verified answers for SEW8b 4xHIT Spring Boot at elearning.tgm.ac.at.
Get instant access to accurate answers and detailed explanations for your course questions. Our community-driven platform helps students succeed!
Kreuzen Sie an, welche Objekt-Initialisierungen sich fehlerfrei kompilieren lassen: [EK]
type Person = { id?: number; name: string };
StrictNullChecks sind aktiviert, der TS-Kompiler unterscheidet also zwischen null und undefined.
"compilerOptions": { "strictNullChecks": true }
Betrachten Sie folgendes Beispiel. Es besteht aus zwei ref Variablen und je einer computed Property, Method und Watcher auf jeder der beiden Variablen. Kreuzen Sie an, was aufgerufen wird, wenn über die Eingabe eines Zeichens im Input-Feld ein Re-Render getriggered wird:
<script setup lang="ts">
import {computed, ref, watch} from "vue";
const count = ref<number>(0);
const countComputed = computed(() => { console.log("countComputed"); return count.value + 1});
function countMethod() { console.log("countMethod"); return count.value - 1; }
watch(count, () => { console.log("countWatch"); })
const name = ref<string>("Max");
const nameComputed = computed(() => { console.log("nameComputed"); return name.value.toUpperCase(); });
function nameMethod() { console.log("nameMethod"); return name.value.toLowerCase(); }
watch(name, () => { console.log("nameWatch"); })
</
script>
<
template>
<
h1>Count</h1>
<
p>{{ count }} <button @click="count++">Increment</button></p>
<
p>{{ countComputed }}</p>
<
p>{{ countMethod() }}</p>
<
h1>Name</h1>
<
p><input v-model="name"></p>
<
p>{{ nameComputed }}</p>
<
p>{{ nameMethod() }}</p>
</
template>
Optional in Java sind korrekt? [EK]Was wird ausgegeben, wenn man die Anwendung startet: [EK]
@Scope("singleton")
@Component
public class GreeterSingleton{
private static int lastId = 0
;
private final int id = ++lastId
;
@Override
public String toString() {
return "GreeterSingleton " + id
;
}
}
@Component
public class ProfileTester implements CommandLineRunner{
@Autowired
private GreeterSingleton greeterSingleton
;
@Autowired
private ApplicationContext context;
@Override
public void run(String... args) throws Exception{
System.out.println(greeterSingleton + "\n" + context.getBean(GreeterSingleton.class
));
}
}
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
));
}
}