DUET PG Score Card 2021
NHAI Recruitment 2021
Bihar Board 12th Dummy Admit Card 2022
RBI Assistant Notification 2021
Jee Advanced 2021 Result
NIACL Assistant Recruitment 2021
SBI PO Online Form 2021

Public Class HolidaysCalculator 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
    package q10776;
    public class HolidaysCalculator {
        public static void main(String[] args) {
            short nationalHolidays = Short.parseShort(args[0]);
            short companyHolidays = Short.parseShort(args[1]);
            short totalHolidays = (short)(nationalHolidays + companyHolidays);
            System.out.println("totalHolidays = " + totalHolidays);
        }
    }

    Candidates having any kind of query so he/she can ask in our comment section. Our Panel will b reverting back as soon as possible. Thank You. For more details visit our website (https://speedjobalert.com/)

    Leave a Comment