Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

Java

Two methods with the same name

Lets say that we import two packages e.g.:

import com.package1.gene; import com.package2.dna;

both of them hava a method with the same name.

How can call the methods?

1 Answer

Check this post:

http://stackoverflow.com/questions/2079823/importing-two-classes-with-same-name-how-to-handle

Quote from there:

You can omit the import statements and refer to them using the entire path.

But

But I would say that using two classes with the same name and a similiar function is usually not the best idea unless you can make it really clear which is which.