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

Java OOP questions, please help, thanks 1. Every javafx.event.Event object has t

ID: 3770574 • Letter: J

Question

Java OOP questions, please help, thanks

1.

Every javafx.event.Event object has the ________ method.

getSource()

getActionCommand()

getTimeStamp()

getWhen()

getKeyChar()

2.

The code in a thread that is different than the main/UI thread should directly manipulate user interface elements?

True

False

3.

What is the Factory OO design pattern?

A method that fills an ArrayList based on a data source.

Saving object data to files using serialization.

Using a method to create objects without having to specify the exact class of the object to be produced.

Using a thread to construct objects based on a timer tick.

4.

Objects of a subclass can be assigned to a super class reference.

True

False

5.

What is the Factory OO design pattern?

A method that fills an ArrayList based on a data source.

Saving object data to files using serialization.

Using a method to create objects without having to specify the exact class of the object to be produced.

Using a thread to construct objects based on a timer tick.

6.

The 'this' keyword is used to resolve conflicts between method parameters and instance fields/methods of the invoked class.

True

False

A.

getSource()

B.

getActionCommand()

C.

getTimeStamp()

D.

getWhen()

E.

getKeyChar()

Explanation / Answer

Answer 1: Every javafx.event.Event object has the getsource() method.

This Methods is inherited from class java.util.EventObject

Answer 2: No, It will not be thread safe.For exampple if the property Get code might consist of multiple operations and the UI thread could act on the same time, halfway during the Get operation, causing unexpected results.

Answer 3: (c) Using a method to create objects without having to specify the exact class of the object to be produced.

The intent for Factory OO design is to creates objects without exposing the instantiation logic to the client and to refers to the newly created object through a common interface also.

Answer 4: Yes , a subclass can be assigned to a super class reference.

This supports by run time polymorphism.method overriding is one example of it.

Answer 5: is reapeated one.

Answer 6: Yes , The 'this' keyword is used to resolve conflicts between method parameters and instance fields/methods of the invoked class when they are same by syntax.

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote