In the Java API, you have a file called Constants.java which contains all the String constants as given in the snippet example below. This is supposed to be used for all API parameter exchanges. The issue is that all these constants need to be declared as "final" for them to actually become constants in Java... i.e. they should all be declared as "public static final", not just as "public static" as they have been declared now. In reality all these variables are not treated as Constants at all by the JVM!!! There are multiple issues that arise out of it... 1. These constants cannot be used in Switch...Case statement, which is one of their primary purpose. 2. Since JVM treats these as variables rather than constants, they take up memory in the JVM eden memory pool which it wouldn't if they were constants, making any application using the API memory and computationally inefficient.
/** Exchanges. */ public static String EXCHANGE_NSE = "NSE"; public static String EXCHANGE_BSE = "BSE"; public static String EXCHANGE_NFO = "NFO"; public static String EXCHANGE_BFO = "BFO"; public static String EXCHANGE_MCX = "MCX"; public static String EXCHANGE_CDS = "CDS";