This file contains 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 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 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 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