Is it possible for an interface to be accessible only in the same package and child packages?
I have defined an interface with default 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 which 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 resolved to a type
So is this a restriction from Java for an interface or am I doing it wrong way?
Thanks