Question: Can someone please tell me what is wrong with the following code? The answer just needs to be short and to the point, no long
Can someone please tell me what is wrong with the following code? The answer just needs to be short and to the point, no long explanations. Thanks!
------------------------------------------------------------------------------------------
public class FindTheError { public static void main(String[] args) { myMethod(0); } public static void myMethod(int num) { System.out.print(num + " "); myMethod(num + 1); } }
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
