[program-java] Re: Java: Constants

  • From: "Sina Bahram" <sbahram@xxxxxxxxx>
  • To: <program-java@xxxxxxxxxxxxx>
  • Date: Wed, 13 Jul 2011 13:06:06 -0400

Final means that it can not be istanciated, nothing having to do with the 
finalness of the things inside.

 

Take care,

Sina

 

From: program-java-bounce@xxxxxxxxxxxxx 
[mailto:program-java-bounce@xxxxxxxxxxxxx] On Behalf Of Stanzel, Susan - Kansas 
City, MO
Sent: Wednesday, July 13, 2011 12:53 PM
To: program-java@xxxxxxxxxxxxx
Subject: [program-java] Re: Java: Constants 

 

Hi Jim C,

 

I think from my reading you can?t have static and final together. I would think 
a final class would mean everything in it is final,
but this really contradicts the whole Java idea.

 

Susie

 

From: program-java-bounce@xxxxxxxxxxxxx 
[mailto:program-java-bounce@xxxxxxxxxxxxx] On Behalf Of Corbett, James
Sent: Wednesday, July 13, 2011 8:49 AM
To: 'program-java@xxxxxxxxxxxxx'
Subject: [program-java] Java: Constants 

 

Hello:

 

If a class is final:

 

Public final class Constants?.

 

Is it implied that all members are by default final or when they are declared 
it's still requires the final key word:

 

Public static final String MY_STRING = "Hello";

 

?and why would a developer have a static import?

 

Jim 

 

James M. Corbett

 

Programmer / Analyst | 

Canada Revenue Agency | Agence du revenue du Canada

875 Heron Rd.

Ottawa, On.

K1A0L5 

 

James.Corbett@xxxxxxxxxxxxx

Telephone | Téléphone: (613) 941-1338  

Facsimile | Télécopieur: (613) 941-2261  

 

Government of Canada | Gouvernement du Canada

 

"Due to the highly confidential nature of my job, I'm not allowed to know what 
I'm doing."

 

 

Other related posts: