wayground logo

Free Printable Worksheets

Font size

S
M
L
XL
Worksheets

Java Wiederholung

Total questions: 18

Worksheet time: 33mins

Name
Class
Date
1.

Welche Bedeutung hat das Schlüsselwort „final“ in Java?

a)

Identifiziert eine Konstanze

b)

Identifiziert eine Zeichenkette

c)

Identifiziert eine Konstante

d)

Final Space

e)

Identifiziert die finale Klasse

2.

Welche der folgenden Wörter sind reservierte Schlüsselwörter in Java?

a)

double

b)

hit

c)

else

d)

int

e)

switch

3.

Welche Variablenbezeichner sind gültig?

a)

ungueltig

b)

1_2_3

c)

Eins

d)

$variabel

e)

double

4.

Welche sind Schlüsslewörter für primitive Datentypen in Java?

a)

char

b)

long

c)

double

d)

float

e)

ultimate

5.

Welchen Wert nimmt die Variabel x an?


int x = 60 % 7

(a)  

6.

Welchen Wert hat x?


int x = 8 : 2 (2 + 2);

a)

16

b)

1

c)

Fehler, deshalb keine Zuweisung

d)

0

7.

Welchen Wert hat x?


int x, y=5, z=2;

x = y \ z;

x++;

a)

2,5

b)

3,5

c)

1,5

d)

3

8.

Welchen Wert hat b?


int zahl = 99;

boolean b;

if ( ! ((zahl == 99) == false) ) { b = true; }

a)

99

b)

Fehler, da b nicht initialisiert

c)

true

d)

false

9.

int x= 1;

if ((true && false) || (true => false) ) int x=2;

elseint x = 3;

a)

1

b)

2

c)

3

d)

Fehler

10.

int a;

a=3;

a = a * a;

a = a * a;

(a)  

11.

Was ist die Ausgabe?


class Frage

{

public static void main ( String[] args )

{

int unitCost = 8;

int items = 5;

System.out.println("Kosten: " + (unitCost * items) );

}

}

a)

Kosten: + 40

b)

Kosten: 8*5

c)

Kosten: 40

d)

"Kosten: " 40

12.

Was ist der Wert von folgendem Ausdruck:


(2 - 6) / 2 + 9

(a)  

13.

Wie lautet die Syntax der for-Schleife?

a)

for ( Initialisierung ; Abbruchbedingung; Schrittweite) { Anweisungen }

b)

for (Initialisierung ; Schrittweite; Abbruchbedingung) { Anweisungen }

c)

for ( Schrittweite; Initialisierung ; Abbruchbedingung) { Anweisungen }

d)

Initialisierung

for (Abbruchbedingung) { Schrittweite; Anweisungen }

14.

Der || Operator bedeutet

a)

nicht

b)

und

c)

entweder oder

d)

Vorsicht Array

e)

oder

15.

int[] nummern = {2,22,5,0,6,2};

nummern[1] = 2;

nummern[nummern[0]] = 1;

int x = nummern[0] + nummern[1] + nummern[2] +nummern[nummern.length-1];


System.out.println( x );

(a)  

16.

public class Test {

public static void main(String[] args) {

int a = 1;

int b = 2;

int c = fkt (a, b);

System.out.println(c);

}

public static int fkt (int a, int b) {

int tmp = b;

a = b;

b = tmp;

return a * b * tmp;

}

}

(a)  

17.

Was ist keine Schleife

a)

if

b)

while

c)

switch

d)

for

18.

Welche der Anweisungen sind korrekt?

a)

String double = "okay";

b)

int i = 32;

c)

double d = 45,0; // 45 Komma 0

d)

boolean o = 1;