Patterns in Constant file
1 posts in topic
Flat View  Flat View

Posted By:   Sriram_Sundararajan
Posted On:   Thursday, February 17, 2005 03:25 PM

Hi all,

I saw two ways of coding a constant file.

Type 1:-

public class Constant{

public static final String STRING_NAME="jguru";



public class Constant{

public static Constant name = new Constant("jguru");


Out of these 2 types which one will improve the
performance and why?



Re: Patterns in Constant file

Posted By:   Anand_Rajasekar  
Posted On:   Thursday, March 10, 2005 05:44 PM

type 1 is good for defining constants
type 2 would be good if you want to simulate a "enum" kind of usage like c++

performance would not be affected either way
About | Sitemap | Contact