Question
class Demo {
@Parameter(names={"--length"})
int length;
@Parameter(names={"--breadth"})
int breadth;
@Parameter(names={"--height","-h"})
int height;
public static void main(String args[])
{
Demo demo = new Demo();
new JCommander(demo, args);
demo.run();
}
public void run()
{
System.out.println(length+" "+ breadth+" "+height);
}
}
a.
2 512 3
b.
2 2 3
c.
512 2 3
d.
512 512 3
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 below snippet run as $ java Demo –length 512 –breadth 2 -h 3 ?
Similar Questions
Discover Related MCQs
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
Q. Which statement is true?
View solution
Q. Which statement is true?
View solution
Q. Which statement is true?
View solution
Q. A class which is declared with the ________ keyword is known as an abstract class in Java.
View solution
Q. Abstract class can have constructors and static methods?
View solution
Q. What is the syntax of abstract class in java?
View solution
Q. A method which is declared as abstract and does not have implementation is known as an _____________?
View solution
Q. An abstract class can have a data member, abstract method, method body (non-abstract method), constructor, and even main() method.
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!