subject

What is result of executing the following code? public class Question11 {
private static int x = 1;
public static void main(String[] args) {
int x = 5;
System. out. printf("local x in main is %d%n", x);
useLocalVariable();
useField();
useLocalVariable();
useField();
System. out. printf("%nlocal x in main is %d%n", x);
}
public static void useLocalVariable() {
int x = 25;
System. out. printf(
"%nlocal x on entering method useLocalVariable is %d%n", x);
++x;
System. out. printf(
"local x before exiting method useLocalVariable is %d%n", x);
}
public static void useField() {
System. out. printf(
"%nfield x on entering method useField is %d%n", x);
x *= 10; // modifies class Scope’s field x
System. out. printf(
"field x before exiting method useField is %d%n", x);
}
}

ansver
Answers: 2

Another question on Computers and Technology

question
Computers and Technology, 22.06.2019 06:00
What are the most likely causes of conflict at the meeting? check all that apply.
Answers: 1
question
Computers and Technology, 23.06.2019 03:10
Acomputer has a two-level cache. suppose that 60% of the memory references hit on the first level cache, 35% hit on the second level, and 5% miss. the access times are 5 nsec, 15 nsec, and 60 nsec, respectively, where the times for the level 2 cache and memory start counting at the moment it is known that they are needed (e.g., a level 2 cache access does not even start until the level 1 cache miss occurs). what is the average access time?
Answers: 1
question
Computers and Technology, 23.06.2019 06:30
How do you write an argumentative essay about the importance of free enterprise ?
Answers: 1
question
Computers and Technology, 24.06.2019 10:00
3. what do the terms multipotentialite, polymath, or scanner mean?
Answers: 2
You know the right answer?
What is result of executing the following code? public class Question11 {
private static int...
Questions
question
Mathematics, 06.03.2020 10:57