Menu
Question Index
...

What will be the output of the following program.

class CalculateArea
{
    public static void main(String s[])
    {
        int width = 20;
        int breadth = 30;

        int area = calculateArea(width, breadth);

        System.out.println("Area : " + area);
    }

    public static int calculateArea(int width, int breadth)
    {
        int area = width * breadth;
        return area;
    }
}


Area : 0
Area : 600
Compilation Error
Area : 600.0

Doubts

Problems

Topic: Is Java Pass by Reference or Pass by Value

Read this topic
Take test on this topic

0
Wrong
Score more than 2 points

© meritcampus 2019

All Rights Reserved.

Open In App