Does a Java class get loaded if I access MyClass.class.getName()?

I want to explicitly initialize some classes during the initialization of my application using `Class.forName`, but in order make that code survive refactorings, I want to use this: Class.forName(MyClass.class.getName()); I wonder: Wouldn't the class be loaded as soon as the `getName` method is executed thus making `Class.forName` unnecessary?

以上就是Does a Java class get loaded if I access MyClass.class.getName()?的详细内容,更多请关注web前端其它相关文章!

赞(0) 打赏
未经允许不得转载:web前端首页 » JavaScript 答疑

评论 抢沙发

  • 昵称 (必填)
  • 邮箱 (必填)
  • 网址

前端开发相关广告投放 更专业 更精准