Home > Back-end >  Motor vehicles
Motor vehicles

Time:10-13

Write a Car Car, have a brand to brand, color, color, size, the size of three attributes,
Brand attributes exposed, color attribute privatisation and write it setxxx and getxxx methods, size property as static variables and initialize a value,
Write a parameterless constructor and only brand, color method in the construction of the two attributes
Has two methods, one is the public of the run () method, print format for "brand as the... Color as... The car is on the road "
The other is a static method show (), print format for "size of... Car is exhibition ", "

Create a Test class Test, create two objects in the main function, respectively called themselves the run () method


,
  • Related