Path: csiph.com!x330-a1.tempe.blueboxinc.net!usenet.pasdenom.info!weretis.net!feeder4.news.weretis.net!news.wtal.de!news.tal.de!fu-berlin.de!uni-berlin.de!individual.net!not-for-mail From: v_borchert@despammed.com (Volker Borchert) Newsgroups: comp.lang.java.programmer Subject: Re: borrowing Constants Date: 24 Sep 2011 09:44:18 GMT Organization: Private site at Eddersheim, Germany Lines: 24 Distribution: world Message-ID: References: X-Trace: individual.net 0Em3FzjbNY4ggcTwigARywvwb2atHma89FCCqf3GTTkew3N7ni Cancel-Lock: sha1:9dGoIvAe7Hmd2YwZAwFNxjxNqBg= Xref: x330-a1.tempe.blueboxinc.net comp.lang.java.programmer:8264 Roedy Green wrote: > If you have some code like this: > > class A > { > static String VERSION = "1.0b"; > } > > and > class B > { > static String VERSION = A.VERSION; > } > > When you use Class B, does all of class A get instantiated? > Does all of class A get put in B's jar? If they're Constants, they should be final, and then the compiler would "inline" the string into B's constant pool. -- "I'm a doctor, not a mechanic." Dr Leonard McCoy "I'm a mechanic, not a doctor." Volker Borchert