Skip to content
Advertisement

How to assign values to Attributes by passing argument using from method?

I need to assign YEAR, MONTH, DAY attributes to values just only using one set method. therefore I pass DATE.YEAR, DATE.MONTH, DATE.DATE as an argument also with values by calling set method line by line. You can make changes anything to the set method. But You cannot make changes to the main method.

JavaScript

Advertisement

Answer

Mark YEAR, MONTH AND DAY as final and use them in comparison in set() method

JavaScript
User contributions licensed under: CC BY-SA
7 People found this is helpful
Advertisement