Java Reference
In-Depth Information
mouseEntered
mouseExited
mousePressed
mouseReleased
javax.swing.AbstractButton
addActionListener
javax.swing.JButton
javax.swing.JLabel
javax.swing.JPanel
javax.swing.Timer
start
stop
REVIEW EXERCISES
Exercise R9.1. Suppose
C
is a class that implements the interfaces
I
and
J
.
Which of the following assignments require a cast?
C c = . . .;
I i = . . .;
J j = . . .;
a.
c = i
;
b.
j = c
;
c.
i = j
;
429
430
Exercise R9.2. Suppose
C
is a class that implements the interfaces
I
and
J
,
and suppose
i
is declared as
I i = new C();
Which of the following statements will throw an exception?
a.
C c = (C) i
;
b.
J j = (J) i
;
c.
i = (I) null
;