Menu
Question Index
...

What will be the output of the following program?

class Equation1
{
    public static void main(String s[])
    {
        int x = 6;
        int y = 3;
        int z = 12;

        int w = method1(x, y, z);
        
        System.out.println("w = " + w);
    }

    public static int method1(int y, int z, int x)
    {
        return (x * z) / y;
    }
}


w = 24
Compilation Error
w = 36
w = 6

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