Public class _ 2_2_nutritionfacts {private final int servingsize; private final int serving; private final int Calories; private final int fat; private final int sodium; private final int Carbohydrate; private _ 2_2_nutritionfacts (Builder) {This. servingsize = builder. servingsize; this. serving = builder. serving; this. calories = builder. calories; this. fat = builder. fat; this. sodium = builder. sodium; this. carbohydrate = builder. carbohydrate;} The establishment of the public static class builder {// builder, which has the same domain as the original class. The objects built through the Builder are assigned to the original object private final int servingsize; // static internal classes cannot reference external class members or methods private final int serving; private int Calories; private int fat; private int sodium; private int Carbohydrate; Public Builder (INT servingsize, int serving) {This. servingsize = servingsize; this. serving = serving;} public builder calories (INT calories) {// a builder is returned for each field modification. Finally, this builder is used to create the object this. calories = Calories; return this;} public builder fat (INT fat) {This. fat = fat; return this;} public builder sodium (INT sodium) {This. sodium = sodium; return this;} public builder carbohydrate (INT carbohydrate) {This. carbohydrate = Carbohydrate; return this;} public _ 2_2_nutritionfacts bicould () {return New _ 2_2_nutritionfacts (this) ;}} public static void main (string ARGs []) {_ 2_2_nutritionfacts food = new _ 2_2_nutritionfacts.builder (20,100 ). calories (100 ). carbohydrate (100 ). fat (1, 100 ). sodium (100 ). biwould () ;}/ ** builder mode: * The Builder is used to create an object. This mode is suitable for constructing a Builder with many parameters, its attributes have the same members as the objects to be constructed. In the builder, each member in the builder defines a modification method, and return this builder public builder fat (INT fat) {This. fat = fat; return this;} then define a builder method and return the public _ 2_2_nutritionfacts build () {retunr new _ 2_2_nutritionfacts (this )} because we need to create a constructor with builder parameters in the build method, we need to define a constructor. Because it is only used internally, private _ 2_2_nutritionfacts (Builder) should be used) {} then assign all the members in the builder to the _ 2_2_nutritionfacts member, and then call New _ 2_2_nutritionfacts.builder () when generating the object (). A (3 ). B (23 ). build ();*/