Line, Circle, and Rectangle are subclasses of rhe class.
- a. Sprite
- b. Geometry
- c. BasicShape
- d. Shape
The “Line”, “Circle” and “Rectangle” are subclasses of the “Shape”.
Hence, the correct answer is option “D”.
Explanation of Solution
Shape class:
- The basic functionality for drawing shapes is included in “Shape” class.
- A specific shape is been drawn by each of the subclasses in “Shape” class.
- The “Shape” class is present in JavaFX library.
- The lines are been drawn using “Line” class.
- The circles are been drawn using “Circle” class.
- The “Shape” class as well as its subclasses is present in “javafx.scene.shape” package.
Example:
The example for a “Line” class constructor is given below:
Line(startX, startY, endX, endY)
Here, “startX” and “startY” denotes starting point’s “X” and “Y” coordinates. The “endX” and “endY” denotes ending point’s “X” and “Y” coordinates.
Explanation for incorrect options:
a. Sprite:
The “Sprite” class does not involve the subclasses for “Line”, “Circle” and “Rectangle”.
Hence, the option “A” is wrong.
b. Geometry:
The “Geometry” class does not involve the subclasses for “Line”, “Circle” and “Rectangle”.
Hence, the option “B” is wrong.
c. BasicShape:
The “BasicShape” class does not involve the subclasses for “Line”, “Circle” and “Rectangle”.
Hence, the option “C” is wrong.
Want to see more full solutions like this?
Chapter 13 Solutions
Starting Out with Java: Early Objects (6th Edition)
Additional Engineering Textbook Solutions
Starting Out with C++ from Control Structures to Objects (8th Edition)
C++ How to Program (10th Edition)
Web Development and Design Foundations with HTML5 (9th Edition) (What's New in Computer Science)
Java: An Introduction to Problem Solving and Programming (8th Edition)
Problem Solving with C++ (10th Edition)
Artificial Intelligence: A Modern Approach
- Please do it in JavaScript or C# 1) Design and implement the class structure for a drawing application. A drawing is made up of a canvas that contains a collection of three different shapes: circles, lines, and boxes. Each shape can be drawn by calling a Draw() method for that shape. The canvas class should also have a draw method that draws all of the shapes it contains. You don’t have to actually draw anything on a screen; you can simulate drawing by writing a message to the console.For example, the code snippet: canvas.Draw();Drawing a circle at...Drawing a line at...etc. (For each shape on the canvas) 2)(Bonus) Consider re-writing the above answer (#1) differently where the canvas does not contain the shapes, but is able to draw any of the three shapes passed to it. Re-design canvas.Draw() if you need to. Your main() program should ask for user input on what shape to draw. Ask once, draw, then exit.could produce something like the following output to the console:arrow_forwardComplete the missing line of code: public class Rectangle { private int width; private int height; public Rectangle( this.width = width3B %3D this.height = height; %3Darrow_forward1. Create the Java Class for the class diagram shown below.arrow_forward
- Computer Science I need the code for this in Alice programming Faery Magic Create a world that has at least 5 different objects from the Furniture Gallery and one Faery from the Fantasy/Faeries Gallery. The Faery has the power to make an object disappear. Everything that the faery touches disappear from the scene. Create an interactive game where the user can click one object at a time from the scene; then, the faery faces that object and moves toward it. Write a recursive method named CheckDistance, that checks whether the faery is very close to the object clicked by the user. If it is, the faery bends over to touch the object. After the faery touches the object, the object disappears (this is the base case of the recursion). If the faery is not yet close enough to the object to be able to touch it, the faery moves a small distance forward and the CheckDistance method is recursively called (this is the recursive case of the recursion). Include instructions for the game that appears…arrow_forwardOthello is played with white and black pieces. When surrounded by opponents on all sides or top and bottom, a piece is caught and its colour is flipped. You must capture one opponent piece on your turn. When neither player can move, the game finishes. Most pieces wins. Othello object-oriented design.arrow_forwardIn JAVA plsarrow_forward
- computer graphic in OpenGlarrow_forwardMath 130 Java programming Code a Java project with two classes: Thank you!arrow_forwardQ code for design in java a circle image of food is placed in an ellipse shape of cream color when a button is placed 9 times then the ellipse starts rotating and so does the circle shape in it.arrow_forward
- Programming with Microsoft Visual Basic 2017Computer ScienceISBN:9781337102124Author:Diane ZakPublisher:Cengage LearningEBK JAVA PROGRAMMINGComputer ScienceISBN:9781337671385Author:FARRELLPublisher:CENGAGE LEARNING - CONSIGNMENTPrinciples of Information Systems (MindTap Course...Computer ScienceISBN:9781285867168Author:Ralph Stair, George ReynoldsPublisher:Cengage Learning
- EBK JAVA PROGRAMMINGComputer ScienceISBN:9781305480537Author:FARRELLPublisher:CENGAGE LEARNING - CONSIGNMENTProgramming Logic & Design ComprehensiveComputer ScienceISBN:9781337669405Author:FARRELLPublisher:Cengage