So you would have code
class Infinite{
public static void infinite(){
System.out.println(1);
infinite();
}
public static void main(String args[]){
infinite();
}
}
If you are a C/C++ programmer there is one more way to generate a true infinite loop using the infamous ‘Goto’. So you can code
public static void infinite(){
cout<<1;
infinite();
}
public static void main(int argc char * argv[]){
infinite();
}
1. Bernardomen
2. Chanti
3. Joe Smith
for getting the answer right.
No comments:
Post a Comment
Solution for this question?