posted 23 years ago
Hi:
The Sun exam does test on AWT hierarchy. Initially it may look like a pure memorizing task. But after coding small programs and trying to depict the hierarchy as a tree, it will become quite easy to remember these. Then all that is required is to just go through the notes and the tree structure again before Exam day.
Compared to java.io package, I don't think there is a lot to memorize here. (Please refer to my post in certification result forum to check out some tips on making java.io study easier. Probably something similar could be applied to java.awt also!)
The exam does test on listeners & adapters. Here again, I don't think this is a pure memorizing task. To study such things in an easy manner, probably some logical method could be devised.
For example, listener is an interface. If the listener interface has more than one method, then a class implementing this interface should implement all the methods, even if the class is actually interested in implementing only one method! So an equiavlent adapter class is provided with all these methods but with empty bodies.
Suppose a class needs to implement just a method, say windowClosing() method of WindowListener interface, then if it implements this interface, it has to provide empty bodies for all the remaining six methods of Windowlistener interface. Now a readymade WindowAdapter class is available with empty methods for all the seven methods of WindowListener interface. So our class can just extend this adapter and override the windowClosing method alone.
Now that this is the main purpose of adapter, to study about which listeners have corresponding adapters, all we need to do is to take note of the listener interfaces having more than one method. Because, if the listener has only one method, then an equivalent adapter will not be there as it is not necessary.
This analysis will make clear that ActionListener, AdjustmentListener, ItemListener etc don't have corresponsing adapters as each of them has only one method.
This information is best given in leading books & tutorials. I thought of explaining this just to show how tasks can be changed from "memorizing" to "logical reasoning & studying" as far as possible.
Hope this helps,
Gaja Venkat
Sun Certfied Programmer for Java 2 Platform