No, that is a function you've shown. An anonymous inner class looks like
this:
public class Foobar {
public static void main( String args[]) {
BaseClass baseClass = new BaseClass() {
public void doit() {
System.out.println("Hello, World!");
}
};
baseClass.doit();
}
}
interface BaseClass {
void doit();
}
In this example I create an anonymous class derived from BaseClass.
Mike
> -----Original Message-----
> From: tclug-devel-admin at mn-linux.org
> [mailto:tclug-devel-admin at mn-linux.org]On Behalf Of Bob Tanner
> Sent: Wednesday, January 23, 2002 12:59 AM
> To: tclug-devel at mn-linux.org
> Subject: [TCLUG-DEVEL] Inner, anonymous classes?
>
>
> Is it just me or are inner-anonymous classes just hard to read?
>
> I believe this is an inner-anonymous class?
>
> public PasswordAuthentication
> getPasswordAuthentication() {
> String username, password;
>
> String result = JOptionPane.showInputDialog("Enter
> 'username,password'");
>
> StringTokenizer st = new StringTokenizer(result, ",");
> username = st.nextToken();
> password = st.nextToken();
>
> return new PasswordAuthentication(username, password);
> }
>
> I'm not sure how to read this code.
>
> Anyone wanna give this a chatty interpretation?
>
>
> --
> Bob Tanner <tanner at real-time.com> | Phone : (952)943-8700
> http://www.mn-linux.org, Minnesota, Linux | Fax : (952)943-8500
> Key fingerprint = 6C E9 51 4F D5 3E 4C 66 62 A9 10 E5 35 85 39 D9
>
> _______________________________________________
> tclug-devel mailing list
> tclug-devel at mn-linux.org
> https://mailman.mn-linux.org/mailman/listinfo/tclug-devel