what are the errors in this given code ? | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

what are the errors in this given code ?

public class practice1 { public static void main (String []asr){ Scanner s=new Scanner(System.in); int x=s.nextInt(),cube=0,unit=0; cube=x*x*x; practice1.method1(cube); public int method1(int a){ if(a%10<10) { if((a%10)==(method2(x))) //Is x not a global variable ? { return a; } else{ System.out.println("Not that no"); } } else { int cube = a%10; method1(cube); } public int method2(int s){ if(s%10<10) { return s%10; } else { int no=s%10; method2(no); } } }

20th Sep 2018, 5:16 AM
Rishabh Kaushik
Rishabh Kaushik - avatar
1 Answer
0
You started methods inside methods.
20th Sep 2018, 12:14 PM
Alexander Santos
Alexander Santos - avatar