What is the output of this code? | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

What is the output of this code?

Type Casting public static void main(String[ ] args) { double x = 1.5; double y = 2.65; sum((int)x, (int)y); } static void sum(int x, int y) { System.out.println(x + y); }

3rd Mar 2021, 5:31 AM
Hanmin Park
Hanmin Park - avatar
9 Answers
+ 5
You can try it in code playground
3rd Mar 2021, 5:36 AM
Atul [Inactive]
+ 4
3
30th Mar 2021, 5:52 AM
Nicole Mitch G. Veranga
Nicole Mitch G. Veranga - avatar
+ 2
copy the code and paste the code in the java playgorind amd hit run then you will get your answer
3rd Mar 2021, 6:00 AM
-1-
+ 1
And make a class too
3rd Mar 2021, 5:37 AM
Atul [Inactive]
+ 1
3
7th Sep 2021, 6:17 AM
S.PUNITHA
0
ty so much
3rd Mar 2021, 5:50 AM
Hanmin Park
Hanmin Park - avatar
0
The output is 3
6th Apr 2021, 12:13 PM
Joseph S. Lablah, Jr
Joseph S. Lablah, Jr - avatar
0
3 correct
3rd Feb 2022, 11:16 PM
R.M.H.G.M. Rajanayaka
0
3 is the Aswer..
30th Apr 2022, 8:59 AM
MAREESWARAN S
MAREESWARAN S - avatar