SDP-3

Descrição

Quiz sobre SDP-3, criado por Aibat Karashev em 17-01-2017.
Aibat Karashev
Quiz por Aibat Karashev, atualizado more than 1 year ago
Aibat Karashev
Criado por Aibat Karashev mais de 7 anos atrás
425
1

Resumo de Recurso

Questão 1

Questão
What will be the output of the program?<br>
Responda
  • Pine
  • Oak
  • Tree
  • Forest
  • Oops

Questão 2

Questão
Select how you would run your program to cause it to print: Arg is 2 <br>
Responda
  • 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

Questão 3

Questão
What is the prototype of the default constructor?<br>
Responda
  • Test()
  • Test
  • public Test()
  • public Test(void)
  • Test(void)

Questão 4

Questão
What is the widest valid returnType for methodA in line 3?<br>
Responda
  • int
  • long
  • byte
  • double
  • void

Questão 5

Questão
Which is valid in a class that extends class A?<br>
Responda
  • 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; }

Questão 6

Questão
What will be the output of the program?<br>
Responda
  • one two three four
  • one two three four one
  • four three two one
  • four one three two

Questão 7

Questão
What will be the output of the program?<br>
Responda
  • AC
  • ACD
  • BD
  • ABCD
  • ABD

Questão 8

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

Questão 9

Questão
What will be the output of the program? <br>
Responda
  • 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

Questão 10

Questão
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?
Responda
  • 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(){}}

Questão 11

Questão
What will be the output of the program?<br>
Responda
  • AB
  • BC
  • BCD
  • ABC
  • ACD

Questão 12

Questão
Which of these will create and start this thread? <br>
Responda
  • new Runnable(MyRunnable).start();
  • new Thread(MyRunnable).run();
  • new Thread(new MyRunnable()).start();
  • new MyRunnable().start();
  • new Runnable(MyRunnable).run();

Questão 13

Questão
What will be an output? <br>
Responda
  • true true
  • true false
  • false true
  • false false
  • Runtime error will occur

Questão 14

Questão
What will be an output? <br>
Responda
  • 24
  • 30
  • 120
  • 720
  • Compilation Error

Questão 15

Questão
What will be an output? <br>
Responda
  • 1
  • 0
  • 5
  • 15
  • Compilation Error
  • Runtime Error

Questão 16

Questão
What will be an output? <br>
Responda
  • 1
  • 0
  • 12
  • 78
  • Compilation error
  • Runtime error

Questão 17

Questão
What will be the output of the program? <br>
Responda
  • Got the exception 10
  • Got the exception e
  • Compilation error
  • Runtime error

Questão 18

Questão
What will be the output of the program? <br>
Responda
  • Got the Test Exception
  • Inside finally block
  • Got the Test Exception <br> Inside finally block
  • Compilation error

Questão 19

Questão
What will be the output of the program? <br>
Responda
  • Compilation error
  • Compiles and runs fine
  • Compiles fine but throws ArithmeticException at runtime

Questão 20

Questão
What will be the output of the program? <br>
Responda
  • 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

Questão 21

Questão
What will be the output of the program? <br>
Responda
  • Compilation error
  • Divide by zero error
  • inside the finally block
  • a = 0
  • a=0 <br> Divide by zero block <br> inside the finally block

Questão 22

Questão
What will be the output of the program?<br>
Responda
  • Compilation error
  • Runtime error
  • ArrayIndexOutOfBoundsException
  • ErrorCode is printed
  • Array is printed

Questão 23

Questão
What will be the output of the program? <br>
Responda
  • Derived::show() called
  • Base::show() called
  • Compilation error
  • Runtime error

Questão 24

Questão
What will be the output of the program? <br>
Responda
  • Derived::show() called
  • Base::show() called
  • Compilation error
  • Runtime error

Questão 25

Questão
What will be the output of the program? <br>
Responda
  • Base
  • Derived
  • Compilation error
  • Runtime error

Questão 26

Questão
What will be the output of the program? <br>
Responda
  • 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

Questão 27

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

Questão 28

Questão
What will be the output of the program? <br>
Responda
  • 20
  • 0
  • Compilation error
  • Runtime error

Questão 29

Questão
What will be the output of the program? <br>
Responda
  • s1 == s2 is: true
  • s1 == s2 is: false
  • true
  • false
  • compilation error
  • runtime exception

Questão 30

Questão
What will be the output of the following program? <br>
Responda
  • BD
  • ABDE
  • BCDE
  • BCD
  • BDE
  • ABCE
  • ABCD
  • ABD

Questão 31

Questão
What will be the output of the following code? <br>
Responda
  • hello caught finally after
  • hello throwit finally
  • hello throwit caught finally after
  • compilation fails
  • hello caught after
  • caught finally after

Questão 32

Questão
What will be the output of the program? <br>
Responda
  • finally
  • Compilation fails
  • exception finished
  • finally finished
  • finally exception finished
  • finally exception

Questão 33

Questão
What will be the output of the program? <br>
Responda
  • ABCD
  • ACD
  • ABD
  • BCD
  • BC
  • BD
  • CD

Questão 34

Questão
What will be the output of the program? <br>
Responda
  • 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

Questão 35

Questão
What will be the output of the program? <br>
Responda
  • Ex0 caught
  • Exception caught
  • Compilation fails on line 2
  • Compilation fails on line 9
  • Compilation fails on line 11

Questão 36

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

Questão 37

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

Questão 38

Questão
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?
Responda
  • 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

Questão 39

Questão
What will be the output? <br>
Responda
  • Got the Test Exception<br> Inside finally block
  • Inside finally block
  • Got the Test Exception
  • Compilation fails

Questão 40

Questão
What will be the output? <br>
Responda
  • 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

Questão 41

Questão
What is the output of the following code segment? <br>
Responda
  • A
  • B
  • C
  • D or lower

Questão 42

Questão
What are the values of I and product after this code is executed? <br>
Responda
  • 9 and 366
  • 9 and 336
  • 8 and 42
  • 8 and 336

Questão 43

Questão
What is the output of the following code fragment? <br>
Responda
  • Error
  • 2 times Hello
  • 3 times Hello
  • No output will be produced

Semelhante

Fundamentos Químicos da vida
Priscila Reinaldo
Espanhol Básico
Alessandra S.
SUS E ATENÇÃO A SAÚDE NO BRASIL
danieleyuri
Gramática - Fonologia - Quiz I
tiago meira de almeida
Brasil Império
kl.a.b
Guerra fria-mapa mental
Valdemar Sievert
Funções Trigonométricas
nathielecosta
Quiz (Interpretação Textual) - T6s
Rodrigo de Freit9506
Uso da vírgula
Kekê Dantas
História do Islamismo
Marcus Vital
Vitaminas
Júlia Figueiredo