热门

最新

红包

立Flag

投票

同城

我的

发布
weixin_48931392
兜兜小
3 年前
trueweixin_48931392

java构造方法

总结:
(1)构造方法的名字和类的名字要相同,大小写字母也要一样。
(2)构造方法不能有返回值类型。
(3)在构造方法体中也不能用return返回一个值。
(4)主要作用是用于对象的初始化
(5)在创建对象时系统自动调用,不能再代码中显示的调用
(6)一个类中可以定义多个构造方法(参数序列要有明显的区别,这样才好区分具体用哪个)
(7)类中不定义构造方法时,系统会自动为该类生成一个没有参数的构造方法。

CSDN App 扫码分享
分享
评论
1
打赏
  • 复制链接
  • 举报
下一条:
用es时异常:Caused by: org.springframework.data.elasticsearch.RestStatusException: Elasticsearch exception [type=mapper_parsing_exception, reason=Failed to parse mapping [_doc]: analyzer [ik_max_word] has not been configured in mappings]; nested exception is ElasticsearchStatusException[Elasticsearch exception [type=mapper_parsing_exception, reason=Failed to parse mapping [_doc]: analyzer [ik_max_word] has not been configured in mappings]]; nested: ElasticsearchException[Elasticsearch exception [type=illegal_argument_exception, reason=analyzer [ik_max_word] has not been configured in mappings]]; 可能解决方法:项目用到了ik分词器,但es没安装ik分词器,给es装个对应的ik分词器再重启试试
立即登录