Answer C
public static void main(String[] args) {
int nums1[] = {1, 2 ,3};
int nums2[] = {1, 2, 3 ,4 ,5};
nums 2 = nums 1; // not defined. The variable has a space between nums and 2
for (int i : nums2) {
System.out.print(i + ":");
}
}
Tested code provided by rachuk
Even though both arrays have different sizes, there's no problem in reassigning their variables. Variables are still nothing else than references to objects.
B is corrent, in line 3 "nums2" becomes a reference of "nums1".
upvoted 2 times
...
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.
MPignaProTech
7 months agoreenarani04325
8 months, 4 weeks agoyanoolthecool
1 year, 5 months agoTerry8420
1 year, 8 months agoManuTov
1 year, 9 months agoSreeni_A
1 year, 9 months agopbbvr
1 year, 9 months agopbbvr
1 year, 9 months agodsms
1 year, 9 months agoyanoolthecool
1 year, 5 months agoKolodets
2 years, 1 month agojackymak
1 year, 10 months agoGaelBernard
2 years, 1 month agoVicky_65
2 years, 1 month agoCreazyyyyGirl
2 years, 2 months agorachuk
2 years, 3 months agoAnnie432
2 years, 4 months agoakbiyik
2 years, 5 months agoiSnover
2 years, 8 months ago