Class test.Test3 can not access a member of class singleton.Single with modifiers “private“

在写java反射时,通过new Instance()获取无参构造时,出现下面错误:

Class test.Test3 can not access a member of class singleton.Single with modifiers "private"

Class test.Test3 can not access a member of class singleton.Single with modifiers “private“
代码如下:
Class test.Test3 can not access a member of class singleton.Single with modifiers “private“
原因:
在我的JavaBean代码中,无参构造函数设置为了私有的,导致无法访问。
更改为public即可。

上一篇:test3


下一篇:事务的 ACID 是指什么?