wood burning stoves 2.0*
The moose likes Java in General and the fly likes Regarding Constant Interface Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Java » Java in General
Bookmark "Regarding Constant Interface" Watch "Regarding Constant Interface" New topic

Regarding Constant Interface

surya.raaj prakash
Ranch Hand

Joined: Oct 30, 2009
Posts: 76
Hi Friends,

Can please explain to me,How constant interface would unnecessarily affect the public API of a class?
Vinoth Kumar Kannan
Ranch Hand

Joined: Aug 19, 2009
Posts: 276

do you mean 'interface for constants' by 'constant interface' ?

Shanky Sohar
Ranch Hand

Joined: Mar 17, 2010
Posts: 1051

i think you are saying about interface.

which is always public and abstract and variable inside it are also public static final.because they are fixed and not supposed to change by the class which is going to be implement he interface

SCJP6.0,My blog Ranchers from Delhi
Campbell Ritchie

Joined: Oct 13, 2005
Posts: 37950
Please Google for constant interface anti-pattern; this, which I haven't read, is the first hit.
Muhammad Khojaye
Ranch Hand

Joined: Apr 12, 2009
Posts: 449

Campbell Ritchie wrote:Please Google for constant interface anti-pattern; this, which I haven't read, is the first hit.

Also this might be useful after reading constant interface anti-pattern.

I agree. Here's the link: http://aspose.com/file-tools
subject: Regarding Constant Interface
Similar Threads
how to access a constant from JSTL
A member interface is implicitly static
Document or not? gazillion public constants in one class
best approach to map constant values
switch/case statement - compilation error even with final.