adplus-dvertising
frame-decoration

Question

What will be the output of the program?
class box 
{
    int width;
    int height;
    int length;
    int volume;
    void volume(int height, int length, int width) 
    {
        volume = width * height * length;
    } 
}    
class Prameterized_method
{
    public static void main(String args[]) 
    {
       box obj = new box();
       obj.height = 1;
       obj.length = 5;
       obj.width = 5;
       obj.volume(3, 2, 1);
       Console.WriteLine(obj.volume);  
       Console.ReadLine();      
    } 
}

a.

0

b.

1

c.

6

d.

25

Answer: (c).6

Engage with the Community - Add Your Comment

Confused About the Answer? Ask for Details Here.

Know the Explanation? Add it Here.

Q. What will be the output of the program?

Similar Questions

Discover Related MCQs

Q. Which of these can be used to differentiate two or more methods having same name?

Q. Which of these methods is executed first before execution of any other thing that takes place in a program?

Q. What is the process of defining more than one method in a class differentiated by parameters known as?

Q. Which of these data types can be used for a method having a return statement in it?

Q. Which among the following is not a preprocessor directive?

Q. Which preprocessor directive among the following forces the compiler to stop the compilation?

Q. What does preprocessor directive #if and #endif explains?

Q. Select the defined preprocessor in C#.NET?

Q. What is meant by preprocessor directive #define?

Q. What is meant by preprocessor directive in C#.NET?

Q. Choose the symbol which begins a preprocessor directive in C#.NET?

Q. Which among the following is the correct statement about the using statement used in C#.NET?

Q. If ListBox is the class of System.Windows.Forms namespace.Then,correct way to create an object of ListBox class is?

Q. Which among the following is a .NET namespace?

Q. Which among the following statements are not correct about a namespace used in C#.NET?

Q. Which among the following is a correct statement about namespace used in C#.NET?

Q. Which among the following does not belong to the C#.NET namespace?

Q. Which is the correct statement about the namespaces in C#.NET?

Q. Which of the following is not a namespace in the .NET Framework Class Library?

Q. Which of the following C#.NET code snippets will correctly print "Hello C#.NET"?