Why isn't calling a static method by way of an instance an error for the Java compiler?

后端 未结 12 2254
北海茫月
北海茫月 2020-11-22 06:59

I\'m sure you all know the behaviour I mean - code such as:

Thread thread = new Thread();
int activeCount = thread.activeCount();

provokes

12条回答
提交回复
热议问题