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

24 Which of the following statements is true? 25 The ActionListener interface co

ID: 3915323 • Letter: 2

Question

24

Which of the following statements is true?

25

The ActionListener interface contains the ____ method specification.

26

Which class do you use to write data to a text file?

27

To create a window, which of the following classes has to be extended?

28

Which of the following correctly declares and initializes a String object?

29

To convert a String to an integer, you use the valueOf() method of the ____ class.

30

To specify an italic font, you pass ____ to the constructor.

31

If a method throws an exception that it will not catch but that will be caught by a different method, you must also use the keyword ____ followed by an Exception type in the method header.

32

An abstract class can contain ____.

33

When you instantiate an object from a class, ____ is reserved for each instance field in the class.

34

___________ can be used to enter or display a string.

The class Exception, which is derived from the class Object, is the superclass of the class Throwable.

Explanation / Answer

24.
Option B: The class Throwable, which is derived from the class Object, is the superclass of the class Exception.
Explanation: Throwable class is derived from Object class

25.
Option B: actionPerformed(ActionEvent e)
Explanation: ActionListener has only one method, it has no corresponding adapter class. This method is called just after the user performs an action.

26.
Option A: File
Explanation: File is class used to work on files(I/O)
Formatter is used to format the variable
Scanner is used to get the input from keyboard.

27.
Option B: JFrame
Explanation: To create a window, JFrame has to be extended.

28.
Option C: String greeting = "Hello";
Explanation: String greeting = "Hello"; initializs the string greeting and declares it to Hello

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