Question
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);
System.out.println(obj.volume);
}
}
a.
0
b.
1
c.
6
d.
25
Posted under Java Programming
Engage with the Community - Add Your Comment
Confused About the Answer? Ask for Details Here.
Know the Explanation? Add it Here.
Q. What is the output of this program?
Similar Questions
Discover Related MCQs
Q. Which of this method is given parameter via command line arguments?
View solution
Q. Which of these data types is used to store command line arguments?
View solution
Q. How many arguments can be passed to main()?
View solution
Q. Which of these is a correct statement about args in this line of code?
public static void main(String args[])
View solution
Q. Can command line arguments be converted into int automatically if required?
View solution
Q. How do we pass command line argument in Eclipse?
View solution
Q. Which class allows parsing of command line arguments?
View solution
Q. Which annotation is used to represent command line input and assigned to correct data type?
View solution
Q. What is the use of @syntax?
View solution
Q. What is Recursion in Java?
View solution
Q. Which of these data types is used by operating system to manage the Recursion in Java?
View solution
Q. Which of these packages contains the exception Stack Overflow in Java?
View solution
Q. Which of the following statements are incorrect?
View solution
Q. Which of these access specifier must be used for class so that it can be inherited by another subclass?
View solution
Q. Which is true about an anonymous inner class?
View solution
Q. Which is true about a method-local inner class?
View solution
Q. Which statement is true about a static nested class?
View solution
Q. Which constructs an anonymous inner class instance?
View solution
Q. What allows the programmer to destroy an object x?
View solution
Q. Which statement is true?
View solution
Suggested Topics
Are you eager to expand your knowledge beyond Java Programming? We've curated a selection of related categories that you might find intriguing.
Click on the categories below to discover a wealth of MCQs and enrich your understanding of Computer Science. Happy exploring!