[Java] Resolving fully qualified name?

S

Stefan.Jia

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
 
A

a24900

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.
 
L

Lew

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.

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,744
Messages
2,569,482
Members
44,901
Latest member
Noble71S45

Latest Threads

Top