[3124] in java-interest

home help back first fref pref prev next nref lref last post

Q on static method reference to class

daemon@ATHENA.MIT.EDU (Bob Beck)
Tue Oct 31 21:33:32 1995

Date: Tue, 31 Oct 95 17:06 PST
To: java-interest@java.sun.com
From: Bob Beck <rbk@ibeam.jf.intel.com>

Suppose I want to refer to the class in a static method, eg to get the name
of the class, or create a new instance... How do I do this?  If I'm in an
instance method, I can say (eg) "getClass().getName()".  However, trying
various things in a static method gets compiler errors.  Surely there must
be a way to do this cleanly without referring to the class by name?
--
Bob Beck                rbk@ibeam.intel.com     CompuServe: 71674,106
Intel Corporation       (503)264-8856           AOL: RDBeck

-
This message was sent to the java-interest mailing list
Info: send 'help' to java-interest-request@java.sun.com

home help back first fref pref prev next nref lref last post