Find error(s), correct it and write output. |Points: 9 ( You are not allowed to add any
Fantastic news! We've Found the answer you've been seeking!
Question:
Find error(s), correct it and write output. |Points: 9
( You are not allowed to add any new codes)
package javaapplication11;
public class Foo {
private int times;
private Foo( )
{
times = 1;
}
}
package javaapplication11;
public class JavaApplication11 {
public static void main(String[] args) {
Foo mytimes = new Foo();
int time = 0;
for (int i = 0; i < 20; i++)
increment(mytimes, time);
System.out.println("times is " + mytimes.times);
System.out.println("times is " + time);
}
public static void increment(Foo f, int times)
{
f.times++;
times++;
}
}
//output:
Related Book For
Income Tax Fundamentals 2013
ISBN: 9781285586618
31st Edition
Authors: Gerald E. Whittenburg, Martha Altus Buller, Steven L Gill
Posted Date: