摘要:
1、@Override 强制检查子类的方法重写java 代码packagecom.test; publicclassOverrideTest{ @OverridepublicStringtoString() { return"Thisisoverride"; } publicstaticvoidmain(String[]args){ OverrideTestot=newOverrideTest(); System.out.println(ot.toString()); } }如下如果不小心把toString()写成了ToString(),则会通不过编译java 代码pack 阅读全文