1.一个java文件只能一个public类,public类的名字与文件名一致。 2.byte,short,char做运算时,结果先会转成int再运算,结果再赋给byte等时,需要做强制类型转换,浮点型同理。