linux_newbie@linuxmail.org says...
> is there any java experts could tell me what the problem below and
> explain the code to me, your explanation is greatly appreciated :)
Where did you get this code? It's terribly ugly to the point of being
practically useless. Nevertheless, here's what it does:
> static Class class$java$awt$event$ActionListener;
Declares a variables called 'class$java$awt$event$ActionListener', which
is a terrible name for a variable. It's legal, but the JLS suggests
reserving the $ character in identifiers for either machine-generated
code names, or compatibility with existing APIs. I suppose the latter
would only apply to native OS function wrappers on VMS.
> static Class _mthclass$(String x$0)
> {
[quoted text clipped - 7 lines]
> }
> }
This defines a method called _mthclass$, which takes as a parameter the
name of a class, and returns the java.lang.Class instance that
represents it. Again, the $ characters are ill-advised.
> MainFrame.class$java$awt$event$ActionListener != null ?
> MainFrame.class$java$awt$event$ActionListener :
> (MainFrame.class$java$awt$event$ActionListener =
> MainFrame._mthclass$("java.awt.event.ActionListener");
This expression attempts to load the class java.awt.event.ActionListener
and assign it's representative java.lang.Class instance to the first
variable above. Once it's loaded once, the previously loaded value is
returned without attempting to reload the class.

Signature
www.designacourse.com
The Easiest Way To Train Anyone... Anywhere.
Chris Smith - Lead Software Developer/Technical Trainer
MindIQ Corporation
linux newbie - 29 Oct 2004 08:27 GMT
> linux_newbie@linuxmail.org says...
>
[quoted text clipped - 37 lines]
> variable above. Once it's loaded once, the previously loaded value is
> returned without attempting to reload the class.
thanks so much :) now i understand it
> is there any java experts could tell me what the problem below and
> explain the code to me, your explanation is greatly appreciated :)
[quoted text clipped - 17 lines]
> (MainFrame.class$java$awt$event$ActionListener =
> MainFrame._mthclass$("java.awt.event.ActionListener");
This looks like reverse engineered or generated code. Probably from a
tool that got it from the class file or obfuscated the source or
something like that...
I wouldn't like to debug this! If you want some help, why don't you show
the real source of this code, or ... why don't you have that?
Paul.
linux newbie - 29 Oct 2004 08:32 GMT
>> is there any java experts could tell me what the problem below and
>> explain the code to me, your explanation is greatly appreciated :)
[quoted text clipped - 25 lines]
>
> Paul.
thanks anyway :)
> is there any java experts could tell me what the problem below and
> explain the code to me, your explanation is greatly appreciated :)
[quoted text clipped - 17 lines]
> (MainFrame.class$java$awt$event$ActionListener =
> MainFrame._mthclass$("java.awt.event.ActionListener");
This looks like compiler generated code to handle the .class synthetic
variable.
EG
if (foo.getClass() == ActionListener.class) { ...