Abbreviated type names in java

Is there a way to shorten type names in java. Something similar to typedef in C ++ or similar to using namespaces?
For example, if I have a type "org.w3c.dom.Node" and I don’t want to write
this full name every time, but I also don’t want to import the whole file,
but only locally define the type "Node" as "org.w3c .dom.Node "by one method?


source to share

2 answers

No, there is no way to create an alias "locally" (I'm taking it "locally", which is what you mean in the method, since you said you didn't want to do import

at the top of a file that is "local" to a file).



You don't want to import this class for the entire file, but what about moving the method (s) that require org.w3c.dom.Node to a new file that has this import?



All Articles