I don't understand this part in Oracle docs?

前端 未结 4 1273
太阳男子
太阳男子 2021-01-23 10:41

Hi I am Ankur and have been coding with java for few years now..I have read Head first Java The Complete Reference by Herbert Schildt earlier and recently I came across a major

4条回答
  •  青春惊慌失措
    2021-01-23 11:11

    If you do not supply a no-arg constructor the compile supplies one for you, as long as there are no other constructors defined. So in your example the compiler will insert the no-arg student() constructor if you comment out you student() constructor.

提交回复
热议问题