Give method intprint( Int x,Int y) in a class sample 2 which calculates and returns the product of cubes of the arguments x andy | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

Give method intprint( Int x,Int y) in a class sample 2 which calculates and returns the product of cubes of the arguments x andy

Please tell

13th Dec 2020, 1:15 PM
Priyanshi Sahu
Priyanshi Sahu - avatar
3 Answers
+ 1
Priyanshi Sahu You have to create a method which has 2 parameters and you just have to return the multiplication of cubes of the arguments x and y return (x * x * x) * (y * y * y);
13th Dec 2020, 1:30 PM
A͢J
A͢J - avatar
0
How?
13th Dec 2020, 1:20 PM
Priyanshi Sahu
Priyanshi Sahu - avatar
0
The method looks like this but I called it "cal" rather then "print"; static int cal(int x,int y){ return //and just add I Am Groot ! Calculation here; } //you use the following to call the method In the main method System.out.print(cal(5,5));
13th Dec 2020, 3:20 PM
D_Stark
D_Stark - avatar