1. 학습
  2. /
  3. 강의
  4. /
  5. Introduction to Object-Oriented Programming in Java

Connected

연습 문제

Creating private properties

Class properties are often made private to restrict external access. For instance, in a Passport class, certain fields should be set only under specific conditions. You will make a car’s registration number private in the Car class to hide it.

지침

100 XP
  • Create a new private property called vehicleNumber that is an int type.