What do people use class loading for?

前端 未结 18 1761
暗喜
暗喜 2021-02-02 14:26

So, every Java text book talks about how flexible Java is since it can load classes at run time. Just cobble together a string and give it to Class.forName(), and

18条回答
  •  忘了有多久
    2021-02-02 15:02

    Well, I've used it for dynamically loading JDBC drivers into a J2EE application. Wheteher this could have been done a better way, I have no idea.

    It was just easier at the time to do the forName() call.

提交回复
热议问题