What is the output of the third 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. f3.i is 1 f3.s is 1
b. f3.i is 1 f3.s is 2
c. f3.i is 1 f3.s is 3
d. f3.i is 3 f3.s is 1
e. f3.i is 3 f3.s is 3
c. f3.i is 1 f3.s is 3
i is an instance variable and s is static, shared by all objects of the Foo class.
You might also like to view...
Given the following function: Pmt(.05/12, 5*12, 50000, 0, 0), how many years is the loan and how much is the initial amount of the loan?
What will be an ideal response?
A(n) ____________________ chart is an effective tool for comparing the relative value of parts to a whole.
Fill in the blank(s) with the appropriate word(s).
The _________tab of the Internet Properties dialog box enables you to configure cookie handling, location services, the pop-up blocker, and InPrivate browser settings
Fill in the blank(s) with correct word
Operational inefficiencies occur because accounts common to many concurrent transactions need to be updated in real time.
Answer the following statement true (T) or false (F)