Is it possible for an interface to be available in only one package and child packages?
I defined an interface with a standard modifier:
package com.mycompany.myapp.dao; import java.io.Serializable; interface BaseDao<T, Id extends Serializable> { public void create(T t); public T readById(Id id); public void update(T t); public void delete(T t); }
Now I have a child package where I want to define a class that implements BaseDao . So I wrote this code:
package com.mycompany.myapp.dao.jpa; import java.io.Serializable; public class BaseDaoJpa<T, Id extends Serializable> implements BaseDao<T, Id> { ... }
But I get this error:
BaseDao cannot be allowed for type
So is this a Java restriction for an interface, or am I doing it wrong?
thanks
source share