kaushik ,You can not declare the member of the interface as private or prtected or default if you does not provide any access modifier that does not mean it is default, the members of the interface are always public.am I correct Ranchers.
Joined: Feb 01, 2007
Oh Ya, it`s working as you both explain. did you give me any link where i can get detail information about this concept and practically where it`s useful to hide visibility of the methods and system Design
Joined: Apr 27, 2008
Access modifiers are treated in K&B chapter 1 and any java tutorial book.
Practically: Think of a helper method of a public method. If the helper method would be public,too, everyone could use it (if you like or not). If you then want to change the parameter list of your helper method, for example, other classes may be affected. But if your helper method is private, nobody else can use it and you don't have to care about any other classes. So your system has less changes and becomes more stable.
Can someone post the code where an interface can be declared private or protected? I wasn't able to create one... getting compile error! That would just help me understand better!... Thanks in advance [ July 21, 2008: Message edited by: Milan Sutaria ]