Created
January 5, 2024 13:08
-
-
Save isaacssemugenyi/e033721049ba69aa8db50ae31103502e to your computer and use it in GitHub Desktop.
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
// remove the countriesPresent method in the inner Builder class and replace it with the method below | |
public Builder addCountry(String countriesPresent){ | |
this.countriesPresent.add(countriesPresent); | |
return this; | |
} | |
// Inside of .countriesPresent(List.of("Mexico", "Brazil")) with .addCountry("Kenya").addCountry("Uganda") in the Main.java | |
Car car3 = new Car.Builder() | |
.make("Ford") | |
.name("Mastunga") | |
.color("Red") | |
.model(2023) | |
.addCountry("Kenya") | |
.addCountry("Uganda") | |
.build(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment