Font size
WorksheetsJava Wiederholung
Total questions: 18
Worksheet time: 33mins
Welche Bedeutung hat das Schlüsselwort „final“ in Java?
Identifiziert eine Konstanze
Identifiziert eine Zeichenkette
Identifiziert eine Konstante
Final Space
Identifiziert die finale Klasse
Welche der folgenden Wörter sind reservierte Schlüsselwörter in Java?
double
hit
else
int
switch
Welche Variablenbezeichner sind gültig?
ungueltig
1_2_3
Eins
$variabel
double
Welche sind Schlüsslewörter für primitive Datentypen in Java?
char
long
double
float
ultimate
Welchen Wert nimmt die Variabel x an?
int x = 60 % 7
(a)
Welchen Wert hat x?
int x = 8 : 2 (2 + 2);
16
1
Fehler, deshalb keine Zuweisung
0
Welchen Wert hat x?
int x, y=5, z=2;
x = y \ z;
x++;
2,5
3,5
1,5
3
Welchen Wert hat b?
int zahl = 99;
boolean b;
if ( ! ((zahl == 99) == false) ) { b = true; }
99
Fehler, da b nicht initialisiert
true
false
int x= 1;
if ((true && false) || (true => false) ) int x=2;
elseint x = 3;
1
2
3
Fehler
int a;
a=3;
a = a * a;
a = a * a;
(a)
Was ist die Ausgabe?
class Frage
{
public static void main ( String[] args )
{
int unitCost = 8;
int items = 5;
System.out.println("Kosten: " + (unitCost * items) );
}
}
Kosten: + 40
Kosten: 8*5
Kosten: 40
"Kosten: " 40
Was ist der Wert von folgendem Ausdruck:
(2 - 6) / 2 + 9
(a)
Wie lautet die Syntax der for-Schleife?
for ( Initialisierung ; Abbruchbedingung; Schrittweite) { Anweisungen }
for (Initialisierung ; Schrittweite; Abbruchbedingung) { Anweisungen }
for ( Schrittweite; Initialisierung ; Abbruchbedingung) { Anweisungen }
Initialisierung
for (Abbruchbedingung) { Schrittweite; Anweisungen }
Der || Operator bedeutet
nicht
und
entweder oder
Vorsicht Array
oder
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)
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)
Was ist keine Schleife
if
while
switch
for
Welche der Anweisungen sind korrekt?
String double = "okay";
int i = 32;
double d = 45,0; // 45 Komma 0
boolean o = 1;
