Menu
Question Index
...

What will be the output of the following program.

class MethodsTest
{
    public static void main(String s[])
    {
        float m = 34;
        float n = 56;
        float o = sum(m, n);
        System.out.println("o = " + o);
    }
    
    public static float Sum(float m, float n)
    {
        System.out.println("m = " + m + " n = " + n);
        return m + n;
    }
}


m = 34 n = 56
o = 90
m = 34.0 n = 56.0
o = 90.0
m = 34.0 n = 56.0
o = 0.0
Compilation Error

Doubts

Problems

Topic: Java Methods - Parameter Passing And Scope

Read this topic
Take test on this topic

0
Wrong
Score more than 2 points

© meritcampus 2019

All Rights Reserved.

Open In App