Lotus Notes / Domino Sonstiges > Java und .NET mit Notes/Domino
[MGW] Woche 1: Declarations and Access Control
Axel Janssen temp:
Neue Frage: (Kategorie: Easy)
--- Code: ---public class Array1 {
//private static int [] zahlen = new int[3];
private static int [] zahlen = {2, 3};
public static void main (String args[] ) {
zahlen = new int [2];
System.out.println(zahlen[2]);
}
}
--- Ende Code ---
Was passiert, wenn man diesen code kompiliert und ausführt?
1. Es wird 0 auf der Konsole ausgegeben.
2. Es wird 3 auf der Konsole ausgegeben.
3. Der code läßt sich nicht kompilieren. (compile time exception)
4. Der code läßt sich nicht ausführen (run time exception)
Axel Janssen temp:
weitere Frage (Kategorie: not that easy):
class I {
public static void main(String[] args) {
int[][] a1 = [[1,2],[3,4,5],[6,7,8,9]];
int[][] a2 = [[1,2],[3,4,5],[6,7,8,9]];
int[][] a3 = [[1,2],[3,4,5],[6,7,8,9]];
System.out.print(a1[0][1]+","+a2[1][2]+","+a3[2][3]);
}
}
What is the result of attempting to compile and run the above program?
a. Prints: 14
b. Prints: 16
c. Prints: 1,5,9
d. Prints: 2,4,8
e. Prints: 2,5,9
f. Compile-time Error.
g. Runtime Error.
h. None of the Above.
-------------------------------------------
Kategorie: difficult
Which of the following statements are true?
a. An abstract method can not be overridden by an abstract method.
b. An instance method that is not abstract can not be overridden by an abstract method.
c. An abstract method declaration can not include a throws clause.
d. The body of an abstract method is represented by a set of empty brackets.
e. None of the above.
---------------------
Kategorie: difficult
Which of the following modifiers can not be used with the abstract modifier in a method declaration?
a. final
b. private
c. protected
d. public
e. static
f. synchronized
g. native
h. strictfp
i. None of the above.
--------------------------------------------------------------------------------------------
Which of the following statements are true?
a. A static method is also known as a class method.
b. A class method is not associated with a particular instance of the class.
c. The keyword "this" can not be used inside the body of a static method.
d. The keyword "super" may be used in the body of a static method.
e. A method that is not static is known as an instance method.
f. None of the above.
Navigation
[0] Themen-Index
[*] Vorherige Sete
Zur normalen Ansicht wechseln