H
horos11
I had a quick question about implementing interfaces and storing those
implementations..
suppose I have a implementation that I defined:
package mycom;
public interface MyInterface
{
public void mymethod();
}
and I put it in file:
mycom/MyInterface.java
and I want to have several different implementations defined for it,
that I want to stick under:
mycom/MyInterface/Implentation1.java
mycom/MyInterface/Implentation2.java
mycom/MyInterface/Implentation3.java
Can you do this? when I go to make my Implementation1, I say:
package mycom.MyInterface;
I get a conflict, apparently with the interface. But this seems the
logical way to structure things. My workaround is to make a directory:
mycom/MyInterfaceImpl
and stuff all implementations there, but this IMO is a hack and I'm
hoping that there are other ways around this (that make sense, camel
case promotes spelling errors, isn't compiler checkable, etc.)
Any ideas?
Ed
implementations..
suppose I have a implementation that I defined:
package mycom;
public interface MyInterface
{
public void mymethod();
}
and I put it in file:
mycom/MyInterface.java
and I want to have several different implementations defined for it,
that I want to stick under:
mycom/MyInterface/Implentation1.java
mycom/MyInterface/Implentation2.java
mycom/MyInterface/Implentation3.java
Can you do this? when I go to make my Implementation1, I say:
package mycom.MyInterface;
I get a conflict, apparently with the interface. But this seems the
logical way to structure things. My workaround is to make a directory:
mycom/MyInterfaceImpl
and stuff all implementations there, but this IMO is a hack and I'm
hoping that there are other ways around this (that make sense, camel
case promotes spelling errors, isn't compiler checkable, etc.)
Any ideas?
Ed