They can't be private...what's the point of a private interface method? It can't be called by anything.
It can't be protected for a similar reason. Interfaces are simply for exposing public functionality to other classes. If you want protected status, then create a new class and inherit the methods, because protected restricts access to the class tree I guess you have to stand back and look at what the "Interface" design is for. It is to allow objects that possibly come from different packages and even vendors (this is the basis for J2EE design and implementation) to interoperate with a known reference point.
If you need to hide methods between your own modules (which this appears, to me, to be your problem) then you should be able to accomplish it with an Abstract Class and get around your issues? Of course, you can also use the default (no) access modifier to allow only package classes and subclasses to call the methods of an interface.
public
This is not necessarily true. The only rules for this are that interface methods may not be private. They may be public, protected, or have the default (blank) access modifier.
Constants and abstract methods. That's it.
Any function or method in Java that is coded by the programmer is called a user defined method in Java. The JAVA API (Application Programming Interface) has a set of predefined classes & methods that are for our usage. Whatever methods we create apart from these are termed as user defined methods. In java we not use the term functions. We call them "Methods"
ContentHandler
public
interface is a list of methods which implements that interface
This is not necessarily true. The only rules for this are that interface methods may not be private. They may be public, protected, or have the default (blank) access modifier.
A tagging interface type in Java is an interface that has not defined methods such as the java.io.Serializable interface.
Interface is collection of abstract methods which has only declaration and no implementation
An interface in Java is like an abstract class, but there are no method bodies allowed in it and it has to be declared with the interface keyword. It is Java's way of getting around the Deadly Diamond of Death. Only abstract methods and constants are allowed in it.
interface Shape { public double getArea(); }
Constants and abstract methods. That's it.
An interface can only have abstract methods or constants in it. A class can have both that and everything else in Java.
While an abstract class can define both abstract and non-abstract methods, an interface can have only abstract methods. Another way interfaces differ from abstract classes is that interfaces have very little flexibility in how the methods and variables defined in the interface are declared. These rules are strict: • All interface methods are implicitly public and abstract. In other words, you do not need to actually type the public or abstract modifiers in the method declaration, but the method is still always public and abstract. (You can use any kind of modifiers in the Abstract class) • All variables defined in an interface must be public, static, and final-in other words, interfaces can declare only constants, not instance variables. • Interface methods must not be static. • Because interface methods are abstract, they cannot be marked final, strictfp, or native. (More on these modifiers later.) • An interface can extend one or more other interfaces. • An interface cannot extend anything but another interface. • An interface cannot implement another interface or class. • An interface must be declared with the keyword interface. You must remember that all interface methods are public and abstract regardless of what you see in the interface definition.
Any function or method in Java that is coded by the programmer is called a user defined method in Java. The JAVA API (Application Programming Interface) has a set of predefined classes & methods that are for our usage. Whatever methods we create apart from these are termed as user defined methods. In java we not use the term functions. We call them "Methods"
ContentHandler