"Wu, Stanley (IM&T)" wrote:

> I need to printout some error messages like "Entering Method A",  "Exiting
> Method A" and etc.  Instead of hard-coding the method names all over the
> places, I wonder if there is class / method I can call to return me the
> current method I am in?
>
> Thanks,
>
> Stan

Hi,


java.lang.class.getName()

public native String getName()

Returns The fully qualified name of this class or interface.

Description:

    This method returns the fully qualified name of the type represented by
this Class object.

    If the object represents the class of an array, the method returns a
String that contains as many left square brackets as there are
    dimensions in the array, followed by a code that indicates the type of
element contained in the base array. Consider the following:

    (new int [3][4][5]).getClass().getName()

    This code returns "[[[I". The codes used to indicate the element type are
as follows:

     Code    Type
     [            array
     B            byte
     C            char
     d            double
     F            float
     I                int
     J                long
     L             fully_qualified_class_name class or interface
     S            short
     Z            boolean

___________________________________________________________________________
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff SERVLET-INTEREST".

Archives: http://archives.java.sun.com/archives/servlet-interest.html
Resources: http://java.sun.com/products/servlet/external-resources.html
LISTSERV Help: http://www.lsoft.com/manuals/user/user.html

Reply via email to