SDP-3

Beschreibung

Quiz am SDP-3, erstellt von Aibat Karashev am 17/01/2017.
Aibat Karashev
Quiz von Aibat Karashev, aktualisiert more than 1 year ago
Aibat Karashev
Erstellt von Aibat Karashev vor mehr als 7 Jahre
425
1

Zusammenfassung der Ressource

Frage 1

Frage
What will be the output of the program?<br>
Antworten
  • Pine
  • Oak
  • Tree
  • Forest
  • Oops

Frage 2

Frage
Select how you would run your program to cause it to print: Arg is 2 <br>
Antworten
  • java Myfile 2 2 2
  • java Myfile 1 2 2 3 4
  • java Myfile 1 3 2 2
  • java Myfile 1 2 2 2
  • java Myfile 0 1 2 3

Frage 3

Frage
What is the prototype of the default constructor?<br>
Antworten
  • Test()
  • Test
  • public Test()
  • public Test(void)
  • Test(void)

Frage 4

Frage
What is the widest valid returnType for methodA in line 3?<br>
Antworten
  • int
  • long
  • byte
  • double
  • void

Frage 5

Frage
Which is valid in a class that extends class A?<br>
Antworten
  • public int method1(int a, int b) {return 0; }
  • private int method1(int a, int b) {return 0; }
  • protected static int method1(int a, int b) {return 0; }
  • public long method1(int a, int b) {return 0; }
  • public static int method1(int a, int b) {return 0; }

Frage 6

Frage
What will be the output of the program?<br>
Antworten
  • one two three four
  • one two three four one
  • four three two one
  • four one three two

Frage 7

Frage
What will be the output of the program?<br>
Antworten
  • AC
  • ACD
  • BD
  • ABCD
  • ABD

Frage 8

Frage
What will be the output of the program after the running program in such way :/> java Test red green blue?<br>
Antworten
  • baz =
  • baz = blue
  • baz = null
  • Runtime Exception
  • Compilation Error

Frage 9

Frage
What will be the output of the program? <br>
Antworten
  • It will print the numbers from 0 to 19 sequentially
  • It will print the numbers from 1 to 20 sequentially
  • It will print the numbers from 0 to 19 but the order is not determined
  • It will print the numbers from 1 to 20 but the order is not determined
  • It will print the numbers from 0 to 9 two times, but the order is not determined

Frage 10

Frage
The following block of code creates a Thread using a Runnable target: <br> Which of the following classes can be used to create the target, so that the preceding code compiles correctly?
Antworten
  • public class MyRunnable extends Runnable{public void run(){}}
  • public class MyRunnable extends Object{public void run(){}}
  • public class MyRunnable implements Runnable{public void run(){}}
  • public class MyRunnable implements Runnable{void run(){}}
  • public class MyRunnable implements Thread{void run(){}}

Frage 11

Frage
What will be the output of the program?<br>
Antworten
  • AB
  • BC
  • BCD
  • ABC
  • ACD

Frage 12

Frage
Which of these will create and start this thread? <br>
Antworten
  • new Runnable(MyRunnable).start();
  • new Thread(MyRunnable).run();
  • new Thread(new MyRunnable()).start();
  • new MyRunnable().start();
  • new Runnable(MyRunnable).run();

Frage 13

Frage
What will be an output? <br>
Antworten
  • true true
  • true false
  • false true
  • false false
  • Runtime error will occur

Frage 14

Frage
What will be an output? <br>
Antworten
  • 24
  • 30
  • 120
  • 720
  • Compilation Error

Frage 15

Frage
What will be an output? <br>
Antworten
  • 1
  • 0
  • 5
  • 15
  • Compilation Error
  • Runtime Error

Frage 16

Frage
What will be an output? <br>
Antworten
  • 1
  • 0
  • 12
  • 78
  • Compilation error
  • Runtime error

Frage 17

Frage
What will be the output of the program? <br>
Antworten
  • Got the exception 10
  • Got the exception e
  • Compilation error
  • Runtime error

Frage 18

Frage
What will be the output of the program? <br>
Antworten
  • Got the Test Exception
  • Inside finally block
  • Got the Test Exception <br> Inside finally block
  • Compilation error

Frage 19

Frage
What will be the output of the program? <br>
Antworten
  • Compilation error
  • Compiles and runs fine
  • Compiles fine but throws ArithmeticException at runtime

Frage 20

Frage
What will be the output of the program? <br>
Antworten
  • Caught base class exception
  • Caught derived class exception
  • Caught base class exception <br> Caught derived class exception
  • Compilation error because derived is not throwable
  • Compilation error because base class exception is caught before derived class

Frage 21

Frage
What will be the output of the program? <br>
Antworten
  • Compilation error
  • Divide by zero error
  • inside the finally block
  • a = 0
  • a=0 <br> Divide by zero block <br> inside the finally block

Frage 22

Frage
What will be the output of the program?<br>
Antworten
  • Compilation error
  • Runtime error
  • ArrayIndexOutOfBoundsException
  • ErrorCode is printed
  • Array is printed

Frage 23

Frage
What will be the output of the program? <br>
Antworten
  • Derived::show() called
  • Base::show() called
  • Compilation error
  • Runtime error

Frage 24

Frage
What will be the output of the program? <br>
Antworten
  • Derived::show() called
  • Base::show() called
  • Compilation error
  • Runtime error

Frage 25

Frage
What will be the output of the program? <br>
Antworten
  • Base
  • Derived
  • Compilation error
  • Runtime error

Frage 26

Frage
What will be the output of the program? <br>
Antworten
  • Compilation error in super.super.Print()
  • Grandparent’s print <br> Child’s Print()
  • Grandparent’s print <br> Parent’s Print <br> Child’s Print()
  • Runtime error

Frage 27

Frage
What will be the output of the program? <br>
Antworten
  • Complex number is (10.0 + 15.0i)
  • Compilation error
  • Runtime error
  • Complex number is Complex@8e2fb5 (where 8e2fb5 is hash code of c)

Frage 28

Frage
What will be the output of the program? <br>
Antworten
  • 20
  • 0
  • Compilation error
  • Runtime error

Frage 29

Frage
What will be the output of the program? <br>
Antworten
  • s1 == s2 is: true
  • s1 == s2 is: false
  • true
  • false
  • compilation error
  • runtime exception

Frage 30

Frage
What will be the output of the following program? <br>
Antworten
  • BD
  • ABDE
  • BCDE
  • BCD
  • BDE
  • ABCE
  • ABCD
  • ABD

Frage 31

Frage
What will be the output of the following code? <br>
Antworten
  • hello caught finally after
  • hello throwit finally
  • hello throwit caught finally after
  • compilation fails
  • hello caught after
  • caught finally after

Frage 32

Frage
What will be the output of the program? <br>
Antworten
  • finally
  • Compilation fails
  • exception finished
  • finally finished
  • finally exception finished
  • finally exception

Frage 33

Frage
What will be the output of the program? <br>
Antworten
  • ABCD
  • ACD
  • ABD
  • BCD
  • BC
  • BD
  • CD

Frage 34

Frage
What will be the output of the program? <br>
Antworten
  • Hello world
  • Hello world Finally executing
  • Finally executing
  • Nothing. The program will not compile because no exceptions are specified
  • Nothing. The program will not compile because no catch clauses are specified

Frage 35

Frage
What will be the output of the program? <br>
Antworten
  • Ex0 caught
  • Exception caught
  • Compilation fails on line 2
  • Compilation fails on line 9
  • Compilation fails on line 11

Frage 36

Frage
What line of code should replace the missing statement to make this program compile? <br>
Antworten
  • import java.io.*;
  • import java.io.PrintWriter
  • include java.io.*;
  • no statement required

Frage 37

Frage
What will be the output of the program?<br>
Antworten
  • 0
  • error
  • Compilation fails
  • An uncaught exception is thrown at runtime
  • No output
  • / by 0

Frage 38

Frage
Given <br> <b> Note: The keyword "instanceof" is use to check whether an object is of a particular type</b><br>What is the result?
Antworten
  • Will produce output as false
  • Compilation fails due to error at line 3
  • Compilation fails due to error at line 4
  • Length of this array is 3
  • Will produce output a true

Frage 39

Frage
What will be the output? <br>
Antworten
  • Got the Test Exception<br> Inside finally block
  • Inside finally block
  • Got the Test Exception
  • Compilation fails

Frage 40

Frage
What will be the output? <br>
Antworten
  • Caught base class exception
  • Caught derived class exception
  • Compiler error because derived is not throwable
  • Compiler error because base class exception is caught before derived class

Frage 41

Frage
What is the output of the following code segment? <br>
Antworten
  • A
  • B
  • C
  • D or lower

Frage 42

Frage
What are the values of I and product after this code is executed? <br>
Antworten
  • 9 and 366
  • 9 and 336
  • 8 and 42
  • 8 and 336

Frage 43

Frage
What is the output of the following code fragment? <br>
Antworten
  • Error
  • 2 times Hello
  • 3 times Hello
  • No output will be produced
Zusammenfassung anzeigen Zusammenfassung ausblenden

ähnlicher Inhalt

Klausurfragen aktuell
Anne Malten
06_Aktiengesellschaft (Karteikarten)
Stefan Kurtenbach
Kopfrechnen: Grundrechenarten, 56 Aufgaben
Stefan Kurtenbach
Stochastik
barbara91
Was darf mit ins Flugzeug?
B G
Neurobiologie Übersicht
Laura Overhoff
Kunststoffe - Einführung
Fabian B.
SL2
N H
Angewandte Sozialpsychologie
Leonie Horn
Parasitologie 2019
Peter Christian Ponn