Ticker

6/recent/ticker-posts

Ad Code

L6, Short Data Type, Identify and correct the error, package q10776

Short Data Type, Identify and correct the error :-


The class HolidaysCalculator is passed two string arguments.
The first argument (args[0]) contains the count of national holidays declared in that country.

The second argument (args[1]) contains the count of company specific holidays.

The below code is supposed to print the total number of holidays as the sum of both national and company holidays.

Fill in the missing code to :

  1. convert the string passed in args[0] to short and assign to nationalHolidays
  2. convert the string passed in args[1] to short and assign to companyHolidays
    1. [Hint: Remember to use type-casting where required.]

Post a Comment

0 Comments