When we say a variable is STATIC in a Java program in the AS400, does it mean that every user session that access the class access the same variable (storage location in memory)?
You have asked a surprisingly tricky question. I'm looking into a way to be certain. Since the most common use is as a constant value, it usually doesn't make much difference.
But you have a specific side-effect in mind that is generally implementation-dependent. If I can prove one way or the other for V5R4, I'll see about V6R1, too.
This might take a day or two if I can get a proper setup going.
Tom
Hi Tom and Philip,
If it were not in the AS400, the answer would be yes because that's what I read in Java books. But when in the IBM i, I am just not sure.
In RPGLE, the static keyword (at least for V5R4) would mean, all programs running in the same job would be accessing the same memory location.
But Java in IBM i? Well...
Also, I am not planning on using it for constants. I can use that to see how many users are accessing a certain application. This is a side project I am doing nn my own time for the company I work for. I am studying Java to augment my skills as a programmer and what better way than to create some utility which I think would be useful to the company.
I'm beginning to think Java in the IBM i side has limited potential... Those who disagree, please enlighten me.
Thanks!
Free Guide: Managing storage for virtual environments
Complete a brief survey to get a complimentary 70-page whitepaper featuring the best methods and solutions for your virtual environment, as well as hypervisor-specific management advice from TechTarget experts. Don’t miss out on this exclusive content!
Discuss This Question: 4  Replies