subject
Computers and Technology, 08.10.2019 02:20 Meiyuh1

What is the output of the second println statement in the main method?
public class foo {
int i;
static int s;

public static void main(string[] args) {
foo f1 = new foo();
system. out. println("f1.i is " + f1.i + " f1.s is " + f1.s);
foo f2 = new foo();
system. out. println("f2.i is " + f2.i + " f2.s is " + f2.s);
foo f3 = new foo();
system. out. println("f3.i is " + f3.i + " f3.s is " + f3.s);
}

public foo() {
i++;
s++;
}
}
a. f2.i is 1 f2.s is 1
b. f2.i is 1 f2.s is 2
c. f2.i is 2 f2.s is 2
d. f2.i is 2 f2.s is 1

ansver
Answers: 2

Another question on Computers and Technology

question
Computers and Technology, 21.06.2019 18:00
Ihave buncha points. does anyone want any?
Answers: 1
question
Computers and Technology, 22.06.2019 10:00
Businesses allocate resources for their best and most productive uses. the more a resource, the more costly it will be. a manufacturer that requires scarce and costly resources is likely to charge for its products.
Answers: 2
question
Computers and Technology, 23.06.2019 03:30
Many everyday occurrences can be represented as a binary bit. for example, a door is open or closed, the stove is on or off, and the fog is asleep or awake. could relationships be represented as a binary value? give example.
Answers: 1
question
Computers and Technology, 23.06.2019 15:30
1. ask the user how many questions are in the quiz. 2. ask the user to enter the key (that is, the correct answers). there should be one answer for each question in the quiz, and each answer should be an integer. e.g., 34 7 13 100 81 3 9 10 321 12 might be the key for a 10-question quiz. you will need to store the key in an array. 3. ask the user to enter the answers for the quiz to be graded. there needs to be one answer for each question. note that these answers do not need to be stored; each answer can simply be compared to the key as it is entered. 4. when the user has entered all of the answers to be graded, print the number correct and the percent correct. 5. add a loop so that the user can grade any number of quizzes with a single key. after the results have been printed for each quiz, ask "grade another quiz? (y/n)." note: you only have one array (the key). you are not creating a new key for each set of quiz answers.
Answers: 3
You know the right answer?
What is the output of the second println statement in the main method?
public class foo {
Questions
question
Mathematics, 28.05.2020 23:04
question
History, 28.05.2020 23:04
question
Computers and Technology, 28.05.2020 23:04
question
Mathematics, 28.05.2020 23:04
question
Mathematics, 28.05.2020 23:04
question
Mathematics, 28.05.2020 23:04
question
Mathematics, 28.05.2020 23:04