If the statement is num2 = num1, the correct answer is B (points to the same location in memory). However, if the statement is indeed num 2 = num 1, the correct answer would be C.
So thanks for confusing people with a substandard question.
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.
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.
BenCristina
1 week, 1 day agoMPignaProTech
8 months, 2 weeks agoreenarani04325
10 months, 1 week agoyanoolthecool
1 year, 7 months agoTerry8420
1 year, 10 months agoManuTov
1 year, 10 months agoSreeni_A
1 year, 10 months agopbbvr
1 year, 10 months agopbbvr
1 year, 10 months agodsms
1 year, 11 months agoyanoolthecool
1 year, 7 months agoKolodets
2 years, 2 months agojackymak
1 year, 12 months agoGaelBernard
2 years, 2 months agoVicky_65
2 years, 3 months agoCreazyyyyGirl
2 years, 4 months agorachuk
2 years, 5 months agoAnnie432
2 years, 5 months agoakbiyik
2 years, 7 months ago