Re: How to implement Global variables in java which can be shared across several files ?
- From: aks_java <atindras@xxxxxxxxx>
- Date: Thu, 11 Jun 2009 12:09:02 -0700 (PDT)
On Jun 7, 12:42 am, Roedy Green <see_webs...@xxxxxxxxxxxxxxxxxxxx>
wrote:
You should avoid global variables. Others may give you hints on how to
refactor to avoid them.
But your technical problem is you used plain calculator instead of
Calculator.calculator. Javac was looking for a calculator variable in
the current class.
Yes, now its working but I just can't figure out how to avoid global
variables. I mean if I create a calculator instance that has to be
used across the I also want to totally separate the business logic
from UI logic so that I'm able to use the same business logic (+, - ,
* , / etc operations) for a command line calculator.
.
- Follow-Ups:
- References:
- Prev by Date: Re: how reapint JLabel
- Next by Date: Re: Java Test Tool
- Previous by thread: Re: How to implement Global variables in java which can be shared across several files ?
- Next by thread: Re: How to implement Global variables in java which can be shared across several files ?
- Index(es):