Geek Builder

Report a typo

Given the Builder pattern classes, implement the GeekBuilder method to compile the program and output the created geek.

Please, do not change the provided code of the classes.

Sample Input 1:

Garry
10

Sample Output 1:

Geek Garry created.
Type : Admin
Languages : [Perl, PowerShell]
Experience : 10 years
Write a program in Java 17
import java.util.List;
import java.util.Scanner;

class Geek {

private String type;
private List<String> languages;
private int experience;

Geek(String type, List<String> languages, int experience) {
this.type = type;
this.languages = languages;
this.experience = experience;
}

public static class GeekBuilder {

private String type;
private List<String> languages;
private int experience;

public GeekBuilder setType(String type) {
this.type = type;
return this;
}

public GeekBuilder setLanguages(List<String> languages) {
this.languages = languages;
return this;
}

public GeekBuilder setExperience(int experience) {
this.experience = experience;
return this;
}

___

Create a free account to access the full topic