+ 1

May someone help me🙊 What is the output of this result?

public static void main (String [ ] args) { doSomething (4); } static void doSomething (int x){ System.out.println (x*x); }

7th May 2017, 4:07 PM
Yasmin
3 Réponses
+ 3
16 ... wouldn't the easiest way to find the output be to simply run It? what's is happening here is simple. Your calling a method and giving it a parameter or 4.. inside the method you are telling it to print x*x .. or, 4*4
7th May 2017, 4:10 PM
LordHill
LordHill - avatar
+ 2
it will be 16
7th May 2017, 4:11 PM
Damião Brito
Damião Brito - avatar
+ 1
Thank you Kyle and Damião
7th May 2017, 4:15 PM
Yasmin