首页 > 其他分享> > 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“
作者:互联网
在写java反射时,通过new Instance()获取无参构造时,出现下面错误:
Class test.Test3 can not access a member of class singleton.Single with modifiers "private"
代码如下:
原因:
在我的JavaBean代码中,无参构造函数设置为了私有的,导致无法访问。
更改为public即可。
标签:Test3,modifiers,singleton,private,class,member,test,Class 来源: https://blog.csdn.net/qq_44768464/article/details/120630951