Simple java question

2006-11-14 Thread temp temp
I declared a private global field called aField. The same variable I decalred in a method . For example public class Test2 { private String aField = aField ; public static void main(String[] args) { Test2 test2 = new Test2();

Re: Simple java question

2006-11-14 Thread paz . periasamy
Mob : +61-0411-354-838 temp temp [EMAIL PROTECTED] 15/11/2006 07:13 AM Please respond to Struts Users Mailing List To: user@struts.apache.org cc: Subject:Simple java question I declared a private global field called aField. The same variable I

RE: Simple java question

2006-11-14 Thread Asthana, Rahul
Rahul -Original Message- From: temp temp [mailto:[EMAIL PROTECTED] Sent: Tuesday, November 14, 2006 3:14 PM To: user@struts.apache.org Subject: Simple java question I declared a private global field called aField. The same variable I decalred in a method

Re: Simple java question

2006-11-14 Thread temp temp
To: user@struts.apache.org cc: Subject:Simple java question I declared a private global field called aField. The same variable I decalred in a method . For example public class Test2 { private String aField = aField

Re: Simple java question

2006-11-14 Thread paz . periasamy
Please respond to Struts Users Mailing List To: Struts Users Mailing List user@struts.apache.org cc: Subject:Re: Simple java question If I donot use this.aField implies that complier will never point to global field ? and only way I can access the global

Re: Simple java question

2006-11-14 Thread Tamas Szabo
:Simple java question I declared a private global field called aField. The same variable I decalred in a method . For example public class Test2 { private String aField = aField ; public static void main(String[] args) { Test2 test2

Re: Simple java question

2006-11-14 Thread Christopher Goldman
On Wed, 2006-11-15 at 06:33 +0800, Tamas Szabo wrote: Well, it isn't a global field is an instance variable of your class. And there is another way to access it. Just rename either the instance variable or the local variable. Tamas Right. While it is possible to do this, it does make it

Re: Simple java question

2006-11-14 Thread Tamas Szabo
Yep, and why we are at it make sure you don't just rename one of them to afield or a_Field or something similar, you get the pattern :-D It might seem to be a good idea and saves you from coming up with some other name but it could cause headache to others or even yourself later on ... Tamas