Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsWhite Papers
Discussion GroupsFirst AidDatabasesJavaBeansGUIJava 3DVirtual MachineCORBASecurityToolsGeneral
Java DirectoryOpen Source ProjectsSample Book ChaptersUser GroupsWeb Resources
Related Topics
Databases.NETMore Topics ...

Java Forum / General / March 2007

Tip: Looking for answers? Try searching our database.

[Java] Resolving fully qualified name?

Thread view: 
Stefan.Jia@googlemail.com - 28 Mar 2007 17:09 GMT
Hello,

is it possible to resolve a class name (method name, type name) to
fully qualified name?
For example:

class Test{
   String s = "";

   void func1(){
       ...
   }
}

class Test2{
   void func2(){
       Test t = new Test();
       t.func1();
   }
}

what i need is,

class Test{
   java.lang.String s = "";

   void Test.func1(){
       ...
   }
}

class Test2{
   void Test2.func2(){
       Test t = new Test();
       Test.func1();
   }
}

Is it possible to do this without byte code analysis?

I have seen in Eclipse that if mouseover a function's name, the fully
qualified name of this function will be popped up.

Thanks!

Regards,
Stefan
a24900@googlemail.com - 28 Mar 2007 19:50 GMT
On Mar 28, 6:09 pm, Stefan....@googlemail.com wrote:
> is it possible to resolve a class name (method name, type name) to
> fully qualified name?

Do what the compiler and IDEs do. Look at the package and import
statements and then check the classpath (in case of the compiler also
the sourcepath) if you can find the class.
Lew - 29 Mar 2007 00:01 GMT
> On Mar 28, 6:09 pm, Stefan....@googlemail.com wrote:
>> is it possible to resolve a class name (method name, type name) to
[quoted text clipped - 3 lines]
> statements and then check the classpath (in case of the compiler also
> the sourcepath) if you can find the class.

Which answer lets you know, if you read it carefully, that the compiler will
resolve the fully-qualified names for your classes if the import and package
statements are correct.

-- Lew


Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2009 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.