小编ren*_*h n的帖子

BuilderExample 类型的方法 builder() 未定义

package ee;
import lombok.Builder;
@Builder
public class BuilderExample {
        public String foo;
        public String ha;
}

package ee;
import ee.BuilderExample ;
public class Main{
public static void main(String a[]){
BuilderExample b=BuilderExample.builder().foo("hi").ha("anything").build();
}}
Run Code Online (Sandbox Code Playgroud)

在这段代码中,它显示了一个错误 The method builder() is undefined for the type BuilderExample Exception in thread "main" java.lang.Error: Unresolved compiler problem: The method builder() is undefined for the type BuilderExample 显示这样的错误为什么?

java eclipse lombok

7
推荐指数
3
解决办法
1万
查看次数

标签 统计

eclipse ×1

java ×1

lombok ×1