-source:Stringyear.int
+Wood()
+Wood(source:String, year:int)
+getSource():String
+getYear():int
+setYear(year:int):void
Wood()-default constructor.
Wood(source:String, year:int) constructor, which sets values to source and year.
getSource():String returns a string s, which is obtained by removing the last character of source string.
getYear():int-return year.
setYear(year:int):void update year new year-old year.
Do not format the result.
The program output might look something like:
Enter source: wood1
Enter source: wood1
Enter year: 5
Enter year: 1
1. Test getSource()
1. Test getSource()
2. Test setYear()
2. Test setYear()
Enter TC (1 or 2): 1
Enter TC (1 or 2): 2
OUTPUT:
Enter new year: 5
wood
OUTPUT:4
Zoom
90%
Close