answer is B,
Sur la ligne 12 du programme, l'utilisation de "x--" dans la méthode isAvailable n'affecte pas la variable x de la méthode principale, car Java est toujours "pass by value".
L'option A fera la sortie "43210".
Option B, vous pouvez générer avec succès "54321".
Option C, cette logique est la même que l'option A.
L'option D, tant que la boucle ne sera pas exécutée.
Answer is B.
To test:
public class Test {
public static void main(String[] args) {
int x = 5;
while(isAvailable(x)) {
System.out.print(x);
x--; // Answer B - Its ok.
}
}
public static boolean isAvailable (int x) {
return x-- > 0 ? true : false;
}
}
This section is not available anymore. Please use the main Exam Page.1z0-808 Exam Questions
Log in to ExamTopics
Sign in:
Community vote distribution
A (35%)
C (25%)
B (20%)
Other
Most Voted
A voting comment increases the vote count for the chosen answer by one.
Upvoting a comment with a selected answer will also increase the vote count towards that answer by one.
So if you see a comment that you already agree with, you can upvote it instead of posting a new comment.
hyodaeun
Highly Voted 6 years, 5 months agoMamlouk_Med
Highly Voted 6 years, 4 months agovic88
Most Recent 7 months, 2 weeks ago7df49fb
1 year, 3 months agoarjunrawatirissoftware
1 year, 9 months agoDarGrin
1 year, 9 months agodsms
1 year, 11 months agoAnixtc
2 years, 1 month agoVicky_65
2 years, 3 months agowillokans
2 years, 7 months agocarloswork
2 years, 7 months agoacyuta
3 years agobakhdak
3 years agoarcher1903
3 years agoarcher1903
3 years, 1 month agoDavid2606
3 years, 5 months agooca808reattempt
3 years, 5 months ago