-
Notifications
You must be signed in to change notification settings - Fork 4
SimilarProjectAndExternalTypeName
Mehdi Mohammadi edited this page Dec 30, 2013
·
1 revision
In some projects, there are types, which have same name with some library types. For using both of them in a class, you should import library type and qualify project type reference with package name. It is opposite in C# so we qualify library type usages with namespace.
Suppose Calender is a project type:
package Test;
public interface Calendar
{
//some code
}
And in another classes of project, we want to use both this interface and java.util.Calendar:
package Test;
import java.util.Calendar;
public class MyCalendar
{
Test.Calendar projectCalendar;
Calendar libraryCalendar;
}
It should be translated like below (Supposed we are in VirtualizationMode so java.util.Calendar is available):
namespace Test
{
public class MyCalendar
{
Test.Calendar projectCalendar;
java.util.Calendar libraryCalendar;
}
}