This topic contains a solution. Click here to go to the answer

Author Question: What is the printout of the second println statement in the main method?public class Foo { int i; ... (Read 51 times)

torybrooks

  • Hero Member
  • *****
  • Posts: 500
What is the printout 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++;
}
}

◦ f2.i is 1 f2.s is 2
◦ f2.i is 1 f2.s is 1
◦ f2.i is 2 f2.s is 2
◦ f2.i is 2 f2.s is 1


Related Topics

Need homework help now?

Ask unlimited questions for free

Ask a Question
Marked as best answer by torybrooks on May 6, 2020

ong527

  • Sr. Member
  • ****
  • Posts: 285
Lorsum iprem. Lorsus sur ipci. Lorsem sur iprem. Lorsum sur ipdi, lorsem sur ipci. Lorsum sur iprium, valum sur ipci et, vala sur ipci. Lorsem sur ipci, lorsa sur iprem. Valus sur ipdi. Lorsus sur iprium nunc, valem sur iprium. Valem sur ipdi. Lorsa sur iprium. Lorsum sur iprium. Valem sur ipdi. Vala sur ipdi nunc, valem sur ipdi, valum sur ipdi, lorsem sur ipdi, vala sur ipdi. Valem sur iprem nunc, lorsa sur iprium. Valum sur ipdi et, lorsus sur ipci. Valem sur iprem. Valem sur ipci. Lorsa sur iprium. Lorsem sur ipci, valus sur iprem. Lorsem sur iprem nunc, valus sur iprium.
Answer Preview
Only 39% of students answer this correctly




torybrooks

  • Member
  • Posts: 500
Reply 2 on: May 6, 2020
Wow, this really help


jackie

  • Member
  • Posts: 324
Reply 3 on: Yesterday
:D TYSM

 

Did you know?

Patients who have been on total parenteral nutrition for more than a few days may need to have foods gradually reintroduced to give the digestive tract time to start working again.

Did you know?

Approximately 15–25% of recognized pregnancies end in miscarriage. However, many miscarriages often occur before a woman even knows she is pregnant.

Did you know?

When blood is exposed to air, it clots. Heparin allows the blood to come in direct contact with air without clotting.

Did you know?

In 1885, the Lloyd Manufacturing Company of Albany, New York, promoted and sold "Cocaine Toothache Drops" at 15 cents per bottle! In 1914, the Harrison Narcotic Act brought the sale and distribution of this drug under federal control.

Did you know?

Symptoms of kidney problems include a loss of appetite, back pain (which may be sudden and intense), chills, abdominal pain, fluid retention, nausea, the urge to urinate, vomiting, and fever.

For a complete list of videos, visit our video library