Skip to main content

Re: Find name of package

No replies
Anonymous

There's no getPackage() method, but you can do something like that:

Class class = object.getClass().getName();

It will return something like

"[Ljava.lang.Object;" and you can parse the result to extract
"java.lang" which would be the package name.

[]s
Daniel
Forum Nokia

-----Original Message-----
From: A mailing list for KVM discussion
[mailto:KVM-INTEREST@JAVA.SUN.COM] On Behalf Of ext
meinterest@MOBILEANDEMBEDDED.ORG
Sent: Friday, August 29, 2008 11:34 AM
To: KVM-INTEREST@JAVA.SUN.COM
Subject: Find name of package

I want to find out the name of package where is class in which I'm
working just as you can find it out in J2SE with
Class_Name.class.getPackage(). Is there solution for J2ME?
[Message sent by forum member 'quo' (quo)]

http://forums.java.net/jive/thread.jspa?messageID=296195

========================================================================
===
To unsubscribe, send email to listserv@java.sun.com and include in the
body of the message "signoff KVM-INTEREST". For general help, send
email to listserv@java.sun.com and include in the body of the message
"help".

===========================================================================
To unsubscribe, send email to listserv@java.sun.com and include in the body
of the message "signoff KVM-INTEREST". For general help, send email to
listserv@java.sun.com and include in the body of the message "help".