C:\Documents and Settings\ben\Desktop\park>javac BenHultinProg1.java
.\IpAddress.java:43: cannot find symbol
symbol : variable octet1
location: class IpAddress
this.octet1 = octet1;
^
.\IpAddress.java:61: cannot find symbol
symbol : variable octet1
location: class IpAddress
return octet1;
^
"Any fool can write code that a computer can understand. Good programmers write code that humans can understand." --- Martin Fowler
Please correct my English.
"Any fool can write code that a computer can understand. Good programmers write code that humans can understand." --- Martin Fowler
Please correct my English.
JDBCSupport - An easy to use, light-weight JDBC framework -
JDBCSupport - An easy to use, light-weight JDBC framework -
C:\Documents and Settings\ben\Desktop\park>javac BenHultinProg1.java
C:\Documents and Settings\ben\Desktop\park>java BenHultinProg1
216.27.6.136
13
21
Exception in thread "main" java.lang.NumberFormatException: For input string: "6
.136"
at java.lang.NumberFormatException.forInputString(Unknown Source)
at java.lang.Integer.parseInt(Unknown Source)
at java.lang.Integer.parseInt(Unknown Source)
at IpAddress.getOctet3(IpAddress.java:75)
at BenHultinProg1.main(BenHultinProg1.java:16)
Sebastian Janisch wrote:I just told you.
octet1 to octet4 are method local variables. They disappear right after the constructor finishes.
How can the getter method then find the variable if it disappeared ???
JDBCSupport - An easy to use, light-weight JDBC framework -
Doody calls. I would really rather that it didn't. Comfort me wise and sterile tiny ad:
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com
|