Consider the following statements.public class Circle{ private double radius; public Circle() { radius = 0.0; } public Circle(double r) { radius = r; } public void set(double r) { radius = r; } public void print() { System.out.println(radius + " " + area + " " + circumference); } public double area() { return 3.14 * radius * radius; } public double circumference() { return 2 * 3.14 * radius; }}Circle myCircle = new Circle();double r;Which of the following statements are valid in Java? (Assume that console is Scanner object initialized to the standard input device.)(i) r =
console.nextDouble(); myCircle.area = 3.14 * r * r; System.out.println(myCircle.area);(ii) r = console.nextDouble(); myCircle.set(r); System.out.println(myCircle.area());
A. Only (i)
B. Only (ii)
C. Both (i) and (ii)
D. None of these
Answer: B
You might also like to view...
Match the following terms to their meanings:
I. Action II. Macro names III. Macro IV. Normal V. Macro group A. Submacro names are needed to distinguish the individual macros B. Limited to 64 characters C. Might not execute properly if run out of order D. Window mode setting when the form property has been set to a pop-up window E. Because macros perform this it is a good practice to start the name with a verb
Case-Based Critical Thinking QuestionsCase 3-1Linda doesn't know much about tweened animation, but she needs a crash course in it to prepare a multimedia presentation for her manager at the end of the week. Her colleague Sasha offers to help. Linda is looking at a series of frames. How can she confirm that a motion tween has been applied?
A. The frames have a light blue background. B. A solid line appears across the frames. C. A dashed line appears across the frames. D. both a. and b.
Images from scanners and digital cameras are ____ images because they need to use continuous color to form the image.
A. resolved B. meta C. vector D. raster
How do you set the margin properties to result in a centered layout?
A. centered B. floating C. top;bottom D. auto