+ 1
Print method result on console
How to print method result on the console? e.g. method: static int num(int x){ int result = x*x; return result; } how can I print result? System.out.print(//......)
3 Answers
+ 1
you are going to call the function in printing function.
for example:
int func(){
return 10;
}
System.out.printIn(func());
(edit)------
in your example you are gonna call it with parameters
System.out.printIn(num(5));
//output: 25
+ 1
Thanks! It helpedâș
0
document.write(x)