public class Counter {
private int value = 0;
private int limit = 5;
public void setLimit(int maximum)
{
limit = maximum;
}
public void undo()
{
value = 0;
}
public void count()
{
value=value+1;
}
public int getValue()
{
return value;
}
public void main(String[] args)
{
if (value < limit)
{
Counter c = new Counter();
System.out.println("Voor " + c.getValue());
c.count();
c.count();
c.count();
System.out.println("Na " + c.getValue());
}
else
{
System.out.println("Limit exceeded" );
}
}
}
[ bericht aangepast op 16 nov 2012 - 16:20 ]
I hope you drown in all the cum you fucking swallow, to get yourself to the top.