[program-java] Re: Java: Precedence

  • From: "Corbett, James" <James.Corbett@xxxxxxxxxxxxx>
  • To: "'program-java@xxxxxxxxxxxxx'" <program-java@xxxxxxxxxxxxx>
  • Date: Tue, 7 Sep 2010 15:54:14 -0400

Nope just a method that declares x. The first line in the class is the public 
constructor.

Jim

-----Original Message-----
From: program-java-bounce@xxxxxxxxxxxxx 
[mailto:program-java-bounce@xxxxxxxxxxxxx] On Behalf Of Homme, James
Sent: September 7, 2010 15:23
To: program-java@xxxxxxxxxxxxx
Subject: [program-java] Re: Java: Precedence

Hi,

According to my baby Java knowledge, I'd expect 11 because there's a class 
inside a class.



Jim



Jim Homme,

Usability Services,

Phone: 412-544-1810. Skype: jim.homme

Internal recipients,  Read my accessibility blog 
<http://mysites.highmark.com/personal/lidikki/Blog/default.aspx> . Discuss 
accessibility here 
<http://collaborate.highmark.com/COP/technical/accessibility/default.aspx> . 
Accessibility Wiki: Breaking news and accessibility advice 
<http://collaborate.highmark.com/COP/technical/accessibility/Accessibility%20Wiki/Forms/AllPages.aspx>



From: program-java-bounce@xxxxxxxxxxxxx 
[mailto:program-java-bounce@xxxxxxxxxxxxx] On Behalf Of Corbett, James
Sent: Tuesday, September 07, 2010 2:21 PM
To: 'program-java@xxxxxxxxxxxxx'
Subject: [program-java] Java: Precedence



Hello all:



I know y'all say don't do that but let's just pretend.



If a member is declared private to the class such as



Public Class MYClass {



Private int x = 0;



Public MYClass() {



}



Public int getX () {

        int x = 11;

        return x;

}



}



What would you expect to have returned as a value of .getX()?



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






________________________________

This e-mail and any attachments to it are confidential and are intended solely 
for use of the individual or entity to whom they are addressed. If you have 
received this e-mail in error, please notify the sender immediately and then 
delete it. If you are not the intended recipient, you must not keep, use, 
disclose, copy or distribute this e-mail without the author's prior permission. 
The views expressed in this e-mail message do not necessarily represent the 
views of Highmark Inc., its subsidiaries, or affiliates.


Other related posts: