Why cast an object type to null?
greetings. i doubt this is specifically related to swing but when i was looking at the source for JMenuItem i made an observation. In the first two constructors below "(Icon)" is cast onto null in the call to ini(). The last constructor does not. Is there any advantage or reason for casting onto null? thanks. jerry.
public JMenuItem(){
this(null, (Icon)null);
}
public JMenuItem(String text){
this(text, (Icon)null);
}
public JMenuItem(String text, Icon icon){
setModel(new DefaultButtonModel());
init(text, icon);
initFocusability();
}
public JMenuItem(String text,int mnemonic){
setModel(new DefaultButtonModel());
init(text,null);
setMnemonic(mnemonic);
initFocusability();
}

