public class WhoAmI {
public void go(){
while(true)
System.out.println("NO! I'M LARS ULRICH!!");
}
public static void main(String[] args){
new WhoAmI().go();
}
}
Both classes define a method which repeatedly prints out "NO! I'M LARS ULRICH!!", called go(). The main(String[] args) method is the one that is set in motion by default, and that creates an instance of the class and sets its go() method in motion. So, in BASIC, it's essentially:
Technically, I think the first one's one to avoid as it calls itself recursively but has no way to get out of the loop, so there's a good possibility it'd fall over having claimed all your memory. BICBW.
no subject
Date: 2005-04-19 11:29 pm (UTC)no subject
Date: 2005-04-19 11:33 pm (UTC)I am but a humble drummer.
no subject
Date: 2005-04-20 07:00 am (UTC)just rendered into Java.
no subject
Date: 2005-04-20 04:53 pm (UTC)I had a ZX Spectrum as a tiddler!
no subject
Date: 2005-04-20 07:02 am (UTC)