Created
May 15, 2010 19:32
-
-
Save rickyclarkson/402365 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Person { | |
final String address = makeAddress(); | |
public String getAddress() { | |
return address; | |
} | |
static String makeAddress() { | |
String result = "1, The Crescent\n"; | |
result += "Codeville"; | |
return result; | |
} | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Person { | |
String address; | |
public String getAddress() { | |
if (address == null) { | |
address = "1, The Crescent\n"; | |
address += "Codeville"; | |
} | |
return address; | |
} | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Person { | |
String address; | |
public String getAddress() { | |
if (address == null) { | |
String result = "1, The Crescent\n"; | |
result += "Codeville"; | |
address = result; | |
} | |
return address; | |
} | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Person { | |
String address; | |
public String getAddress() { | |
if (address == null) { | |
address = makeAddress(); | |
} | |
return address; | |
} | |
static String makeAddress() { | |
String result = "1, The Crescent\n"; | |
result += "Codeville"; | |
return result; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment