You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
// one class needs to have a main() methodpublicclassHelloWorld
{
// arguments are passed using the text field below this editorpublicstaticvoidmain(String[] args)
{
TestRecurser = newTestRecurse();
r.recurse(10);
System.out.println("Recursion: " + r.c);
}
}
publicclassTestRecurseextendsBadRecurse
{
publicintc = 0;
@Overridepublicvoidrecurse(intcount)
{
c++;
super.recurse(count);
}
}
// you can add other public classes to this editor in any orderpublicclassRecurse
{
publicvoidrecurse(intcount)
{
if(count < 0)
return;
System.out.println(count);
recurse(count-1);
}
}
// you can add other public classes to this editor in any orderpublicclassBadRecurse
{
publicvoidrecurse(intcount)
{
for(inti = 10; i >= 0; i--)
System.out.println(i);
}
}