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, 23.06.2019 01:30
For a typical middle-income family, what is the estimated cost of raising a child to the age of 18? $145,500 $245,340 $304,340 $455,500
Answers: 2
question
Computers and Technology, 23.06.2019 21:00
Will this setup result in what kathy wants to print?
Answers: 2
question
Computers and Technology, 24.06.2019 01:00
What shows the web address of the page that is currently displayed in the workspace? status window toolbar location bar internet box
Answers: 1
question
Computers and Technology, 25.06.2019 00:00
Rom is designed for computer instructions temporary storage of data processing data
Answers: 1
You know the right answer?
What is the output of the second println statement in the main method?
public class foo {
Questions
question
Mathematics, 27.02.2021 16:50
question
Mathematics, 27.02.2021 16:50
question
Mathematics, 27.02.2021 16:50
Questions on the website: 13722361