Answer is E.
To test:
public class Test {
int a1;
public static void doProduct(int a) {
a = a * a;
}
public static void doString(String s) {
s.concat(" " + s);
}
public static void main (String [] args) {
Test item = new Test();
item.a1 = 11;
String sb = "Hello";
Integer i = 10;
doProduct(i);
doString(sb);
doProduct(item.a1);
System.out.println(i + " " + sb + " " + item.a1);
}
}
The answer is the letter E, the values were not changed because in the lines where the methods were started, they were not registered in any variable since "sb" and "i" are not objects and there is no operation with "a1 " , it's just an instance variable of the Test class and is not used by any methods.
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.
WeeChungus
2 weeks, 3 days agoakbiyik
6 months, 2 weeks agocarloswork
7 months, 1 week agoiSnover
8 months, 1 week ago