Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

1. The Administrative and MedStaff classes extend the Staff class. The Staff cla

ID: 3710876 • Letter: 1

Question

1. The Administrative and MedStaff classes extend the Staff class. The Staff class implements the Comparable interface: a. Staff instanceof Comparable b. Staff will contain a method named compareTo. -toff instanceof MedStaff e above 2. In JavaFX, the equivalent to a Window is a a. Node b. Pane C. Stage d. Scene e. None of the above 3. Given that the Motorcycle class extends the abstract Vehicle class. Select the correct answer about the following Java code Vehicle v- new Motorcycle O: Motorcycle m a. The no-arg constructors for Vehicle and Motorcycle will be executed. b. When the code executes, explicit casting will take place. c. The statements would always generate a compiler error 4. What type of object will be sent to a listener that handles a button click? b. MouseEvent ClickEvent None of the above d. e. 5. Most appropriate layout Pane for the displayed GUI a. BorderPane b. GridPane C. HBox d. VBox e. FlowPane My App 6. A class contract consists of A. public methods B. private instance variables C. private class variables D. public constants E. A, C,D F. A and D Page 2

Explanation / Answer

ANSWER

GIVEN THAT

1.

The similar interface in Java contains an theoretical method compareTo.
Any class which implements an border must define all the abstract method of the interface being implemented.
Therefore, personnel will contain a method name compareTo.
The instanceOf keyword in java is used to check whether an object is an example of the given class or not.
Since the class Staff is implement the interface analogous therefore, the object of the group of students Staff is an instance of the border similar.
Since the class MedStaff extend the class Staff so, the class MedStaff is an example of the class Staff.
The instanceof keyword in java is second-hand to check whether an object is an example of the known class or not.
Hence,
the options a and b are true.
so,
the correct option is e.

2.

The phase in Javafx is the base window to make the interface of the request. The GUI plan of an application is complete in the Stage.

Hence,
the correct option is c.

3.

When an thing of the class extending one more class is created, the constructors of both the lessons are called to define the thing.
Since the class Motorcycle extend the class Vehicle therefore, the thing definition of the class Motorcycle invoke the constructors of together Motorcycle as well as Vehicle.
Since no parameters are life form passed at the time of the object meaning therefore, the non-payment constructors are call
Hence,
the correct option is a.
4.

The listener have to handle the happening of a button click.
Since the button clicking occasion may or may not include a mouse click so, the listener must handle action perform from any of the button.
Since, the actions on or after all the button are to be handled therefore, the Action Event thing is passed to the listener.
Hence
the correct option is c.

5.

The given explain contains a row with a solitary column at the top. The Border Pane’s pinnacle region can be used to stand for this section.
The second row in the layout is separated into two column. The right and middle region of the Border Pane can be used to identify these region.
Hence,
the correct option is a.

6.

A agreement in Java refers to the classifications with which the interface of is to exist implement by a class.
Therefore, the agreement refers to the method and the variables of the interface that can be used by the lessons that are implement it.
A class contract contains the public methods that must be redefined by the class that is implement the interface.
A class contract contain the public constants so as to can be used by the group of students that is implement the interface.
Therefore,
options A and D are true.

Hence,
the correct option is F.