Click here to Skip to main content
16,011,757 members
Home / Discussions / Java
   

Java

 
QuestionList in java Pin
RORY1718-May-12 10:36
RORY1718-May-12 10:36 
AnswerRe: List in java Pin
jschell18-May-12 12:21
jschell18-May-12 12:21 
AnswerRe: List in java Pin
TorstenH.19-May-12 1:02
TorstenH.19-May-12 1:02 
AnswerRe: List in java Pin
CodingLover28-May-12 18:00
CodingLover28-May-12 18:00 
QuestionGlobal Variable - Problem in diff. session. Pin
Nanda_MR16-May-12 22:04
Nanda_MR16-May-12 22:04 
AnswerRe: Global Variable - Problem in diff. session. Pin
Nagy Vilmos16-May-12 22:27
professionalNagy Vilmos16-May-12 22:27 
GeneralRe: Global Variable - Problem in diff. session. Pin
Nanda_MR16-May-12 22:40
Nanda_MR16-May-12 22:40 
GeneralRe: Global Variable - Problem in diff. session. Pin
Nagy Vilmos16-May-12 23:26
professionalNagy Vilmos16-May-12 23:26 
Now I understand.


You have an instance for each user, so the variable must not be static. If it is possible to set the value in the constructor, then that is the best thing because you can make the member variable final and so it cannot be changed.


It is strongly advised to not expose member variables outside the class, it is ALWAYS better to use in this case a method; as I used in my example. If the variable is final, then you can to some extent relax the rule as there is no way it can be changed; but this is normally reserved for constants.


Panic, Chaos, Destruction. My work here is done.
Drink. Get drunk. Fall over - P O'H
OK, I will win to day or my name isn't Ethel Crudacre! - DD Ethel Crudacre
I cannot live by bread alone. Bacon and ketchup are needed as well. - Trollslayer
Have a bit more patience with newbies. Of course some of them act dumb - they're often *students*, for heaven's sake - Terry Pratchett

GeneralRe: Global Variable - Problem in diff. session. Pin
TorstenH.17-May-12 1:17
TorstenH.17-May-12 1:17 
AnswerRe: Global Variable - Problem in diff. session. Pin
jschell17-May-12 11:18
jschell17-May-12 11:18 
QuestionGet the project path using Java. Pin
hansoctantan16-May-12 0:39
professionalhansoctantan16-May-12 0:39 
AnswerRe: Get the project path using Java. Pin
TorstenH.16-May-12 0:59
TorstenH.16-May-12 0:59 
GeneralRe: Get the project path using Java. Pin
hansoctantan16-May-12 4:21
professionalhansoctantan16-May-12 4:21 
GeneralRe: Get the project path using Java. Pin
TorstenH.17-May-12 1:18
TorstenH.17-May-12 1:18 
GeneralRe: Get the project path using Java. Pin
hansoctantan18-May-12 0:01
professionalhansoctantan18-May-12 0:01 
Questionconvert video to byte Pin
jiojo15-May-12 23:30
jiojo15-May-12 23:30 
AnswerRe: convert video to byte Pin
TorstenH.16-May-12 0:56
TorstenH.16-May-12 0:56 
QuestionVideo Conferencing using Java Media Framewrok and Servlet. Pin
Solanki Savan15-May-12 23:09
Solanki Savan15-May-12 23:09 
AnswerRe: Video Conferencing using Java Media Framewrok and Servlet. Pin
TorstenH.16-May-12 1:03
TorstenH.16-May-12 1:03 
QuestionOverloading Concepts Pin
Ayyanar G11-May-12 3:27
Ayyanar G11-May-12 3:27 
AnswerRe: Overloading Concepts Pin
TorstenH.11-May-12 3:58
TorstenH.11-May-12 3:58 
Questionproblem of a deployment in tomcat server Pin
Bouali tayeb10-May-12 0:04
Bouali tayeb10-May-12 0:04 
AnswerRe: problem of a deployment in tomcat server Pin
Gerben Jongerius10-May-12 9:20
Gerben Jongerius10-May-12 9:20 
QuestionCloud Computing For Agent Based Urban Transportation System Pin
cloudagent9-May-12 8:25
cloudagent9-May-12 8:25 
AnswerRe: Cloud Computing For Agent Based Urban Transportation System Pin
Richard MacCutchan9-May-12 9:04
mveRichard MacCutchan9-May-12 9:04 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.