The correct answer is the letter B, notice that when instantiating [3][1] it is informing that it is a matrix of 3 lines and a column and as java indexes from 0 we have the line 0,1,2 only with the column 0 and the values it has in each position is 10.
For Test:
public static void main(String[] args) {
int num[][] = new int[3][1];
for (int i = 0; i < num.length; i++) {
for (int j = 0; j < num[i].length; j++) {
num[i][j] = 10;
System.out.println("num ["+ i + "]" + "[" + j + "]" + "=" + num[i][j]);
}
}
}
upvoted 1 times
...
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.
iSnover
Highly Voted 2 years, 3 months agoMPignaProTech
Most Recent 2 months, 3 weeks agoepicbrozo86
2 years, 1 month ago