logo

Crowdly

Browser

Add to Chrome

Course 5716

Looking for Course 5716 test answers and solutions? Browse our comprehensive collection of verified answers for Course 5716 at moodle.hftm.ch.

Get instant access to accurate answers and detailed explanations for your course questions. Our community-driven platform helps students succeed!

(Richtzeit: 3 Minuten)

Gegeben ist folgender Source-Code

public int add(int a, int b, int c) {

return(a+b+c);

}

public int add(int a, int b){

// Welcher Code kommt hier?

}

Welcher Source-Code passt, damit die untere add-Methode die obere aufruft und die Summe von a und b dadurch berechnet wird?

View this question

(Richtzeit: 3 Minuten)

Gegeben ist folgender Source-Code

String s1 = "Hello";

String s2 = "Welcome";

s1 = s2;

s2 = "Hello";

System.out.println("s1: " +s1);

System.out.println("s2: " +s2);

 

Welcher Output erscheint auf der Konsole?

View this question

(Richtzeit: 1 Minute)

Gegeben ist folgender Source-Code

Student s = new Student();

 

Welcher Typ hat die Variable s? (Wähle die genauste Aussage.)

View this question

(Richtzeit: 1 Minute)

Welches Schlüsselwort verwendest du, um ein Attribut zu definieren, wessen Wert für die gesamte Klasse gilt und nicht nur für eine einzelne Instanz?

View this question

(Richtzeit: 3 Minuten)

Gegeben ist der folgende Source-Code:

int[] arr = new int[5];

for(int i=0; i<arr.length; i++){

arr[i] = i;

}

for(int i=0; i<arr.length; i++) {

System.out.print(arr[i]);

}

Welche Ausgabe wird dabei erzielt?

View this question

Void-Methoden können keine Werte zurückgeben.

100%
0%
View this question

Mit welchem Schlüsselwort werden neue Objekte angelegt?

View this question

Welche Ausgabe erzeugt der folgende Code?

public class Aufgabe8 {

public static void main(String[] args) {

for (int i = 0; i < 10; i++) {

if (i % 2 == 0)

System.out.print('x');

else

System.out.print(i);

}

}

}

View this question

Welche Ausgabe erzeugt der folgende Code?

public class Aufgabe4 {

public static void main(String[] args) {

byte b = 127;

System.out.println(++b);

}

}

View this question

Welche Ausgabe erzeugt der folgende Code?

public class Aufgabe6 {

static int i = 5;

static int j = 6;

public static void main(String[] args) {

int i = 3;

int j = 4;

int k = addiere(i,j);

System.out.println(k);

int l = addiere2(i,j);

System.out.println(l);

}

private static int addiere(int i, int j) {

return i + j;

}

private static int addiere2(int k, int l) {

return i + j;

}

}

View this question

Want instant access to all verified answers on moodle.hftm.ch?

Get Unlimited Answers To Exam Questions - Install Crowdly Extension Now!

Browser

Add to Chrome