Шукаєте відповіді та рішення тестів для 367.044, VL Vertiefung Softwareentwicklung, Karin Anna Hummel, 2024S? Перегляньте нашу велику колекцію перевірених відповідей для 367.044, VL Vertiefung Softwareentwicklung, Karin Anna Hummel, 2024S в moodle.jku.at.
Отримайте миттєвий доступ до точних відповідей та детальних пояснень для питань вашого курсу. Наша платформа, створена спільнотою, допомагає студентам досягати успіху!
What is true about threads?
a) Threads of one process have access to each other's data (memory).
b) If you wish to define a class that extends MyString and can be used to create a thread, you may define the class to implement the interface Runnable.
c) The method wait() is used to wait for another thread to exit.
d) In every Java application, at least one thread is running.
Which of the following statements start a new thread?
a)
Thread t1 = new Thread(()-> System.out.println("I want to run ..."));t1.start();
b)
Thread t2 = new Thread(new Runnable() { @Override public void run() { System.out.println("I want to run ..."); }});t2.start();
c)
Thread t3 = new Thread (()->System.out.println("I want to run ..."));t3.run();
d)
Runnable t4 = () -> System.out.println("I want to run");t4.start();
Which statements are true for generics and generic arrays? a) At compile time, an unbounded generic type is resolved to type Object. b) When deriving a generic class, this subclass is NOT allowed to use more type parameters than the superclass. c) Constraining a type parameter T with an interface IF is implemented as: T implements IF. d) Given a type parameter T, an array can be declared and initialized as: T[] myArray = new T[10].
In which of the following statements is the variable s defined as a generic type?a) String s = “This is a string”;b) Object s = new String(“This is a string”);c) class B {} class A<T extends B> { T s; T getS() { return s; } }d) class T {} class R extends T {} T s = new R();
Which of the following statements are true?Assume that class WildAnimal and its subclass class Tiger extends WildAnimal exist. a) Using List<? extends WildAnimal> is a case of contravariance. b) In class List<E>, where E is a paramter type, the method add is implemented that allows to add an element of type E to the list: void add (E elem) {…} Can you build a concrete List (list with concretized types) for adding and storing WildAnimal objects? c) Using List<? super Tiger> is a case of contravariance. d) List<?> is compatible to a concrete List of any type.
Which are correct uses of generics (R,S,T are type parameters)?a) class A <T,S> { S x; T y; } b) class A <T,S> { T x; R y; } c) class A { } class B <T extends Throwable> extends A { }
d) class A extends Throwable {} class B <T> extends A { }