Interface
Can someone explain to me what an interface is and how to use an interface.
for example if the interface looked like this....
public interface Data {
public abstract int someMethod();
public abstract int someMethod2();
public abstract String toString();
}
What I thought was that the interface was used to extend another class... but when I attempt something like...
public class useData extends Data () {
}
i get an error like "a superclass must be a class." And I understand what that means... but now I dont know what an interface is.
Thanks
for example if the interface looked like this....
public interface Data {
public abstract int someMethod();
public abstract int someMethod2();
public abstract String toString();
}
What I thought was that the interface was used to extend another class... but when I attempt something like...
public class useData extends Data () {
}
i get an error like "a superclass must be a class." And I understand what that means... but now I dont know what an interface is.
Thanks
