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

Need help with java homework. 1. What is the name for a method that responds to

ID: 3734475 • Letter: N

Question

Need help with java homework.

1. What is the name for a method that responds to events?

A. Call by Parameter

B. Call by Object

C. Call by Value

D. All of the above

2. What is the name for a method that responds to events?

A. A container method

B. A listener method

C. An application method

D. A snoop method

3. The following is a definition of an abstract class Book using Java.

abstract class Book {

    String title;

    abstract void setTitle(String s);

    String getTitle() {

        return title;

    }

}

What occurs when the following line of code is compiled?

Book novel = new Book();

A. A new Book is instantiated

B. A compiler warning

C. A compiler error

D. Nothing

4. Fill in the blanks so that this program displays a Java GUI frame:

public class MyFrame {
   public static void main ( String [] args ) {

      JFrame frame = new _________( “My JFrame” );

      frame.___________( 150, 150 );

      frame.___________( true );

   }

}

A. JFrame, setVisible, setSize

B. JWindow, setSize, paint

C. JForm, setVisible, setOn

D. JFrame, setSize, setVisible

Explanation / Answer

1. Answer is D : All of the above. All are valid
2.B - listener method
3.C - We can not create an object of abstract class
4. The correct answer is D