Interesting
Redeclaring a Variable in the Initialization Block resulting in the compiler error because of a duplicate variable declaration
int i = 0;
for(int i = 4; i < 5; i++) // DOES NOT COMPIL
1-5 is the correct,
print only when x is a impar number => result can be 1-5 and 3-3 but 3-3 so no match with the for condition (x<y) so breack loop and print only 1-5
public class Tester {
public static void main(String[] args) {
int x = 0, y = 6;
for (; x < y; x++, y--) {
if (x % 2 == 0) {
continue;
}
System.out.println(x + "-" + y);
}
}
}
Result: 1-5 , choose C.
b is correct:
ublic class Principal {
public static void main(String[] args) {
int x = 0, y = 6;
for (; x < y; x++, y--) {
System.out.println(x + "-" + y);
}
}
}
0-6
1-5
2-4
This section is not available anymore. Please use the main Exam Page.1z0-819 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.
Taggert
8 months, 1 week agoASPushkin
9 months agod7bb0b2
1 year, 5 months agojames2033
1 year, 8 months agoqulyt
1 year, 10 months agogopu_azure32
2 years agoStavok
2 years agoJGR_77
2 years, 3 months agoJGR_77
2 years, 3 months agod7bb0b2
1 year, 5 months agokavithaprasanth
2 years, 3 months agoGuru_01
2 years, 4 months agoAnkit1010
2 years, 5 months agoUcefSoft
2 years, 7 months ago