CS321 Chapter 4
In Java every class must have a name. Anonymous classes are not allowed.
False
Polymorphism means that different methods are selected according to the interface or actual object type whichever is more consistent with the programmer's intentions.
False
When an overridden method is called through a superclass reference, Java determines which version(superclass/subclasses) of that method is to be executed based upon the type of the object being referred to at the time the code is compiled.
False
A JFrame can be used to display content in what is commonly called a window.
True
A JOptionPane can be used to display messages to the user.
True
An instance of the Timer class in the javax.swing package can be used for simple animation.
True
Components such as JButton or JTextPane can be added to a JFrame.
True
If a class declares that it implements an interface and does not implement all of the methods of the interface, then the class must be declared abstract.
True
In Java, actionPerformed is the method in the ActionListener class that must be implemented for a JButton to respond to a mouse click.
True
In Java, there is no need to create a subclass for the Icon interface. The programmer only needs to implement the contracted methods.
True
In a correct Java program, a variable can be of either an interface type or a class type.
True
Multiple classes can implement the same interface type but a class can extend only one superclass.
True
Runtime polymorphism is also known as dynamic method dispatch and it is a process in which a function call to the overridden method is resolved at runtime
True
Until Java 8, interfaces could contain no implementations. As of Java 8 default implementations are allowed.
True