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); } } }
1 Answer
0
You started methods inside methods.