Maksud3

part2

Nov 26th, 2020
554
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. package com.epam.rd.java.basic.practice1;
  2.  
  3. public class Part2 {
  4.     public static void main(String[] args) {
  5.         int sum = 0;
  6.         for (String numberStr : args) {
  7.             try {
  8.                 int number = Integer.parseInt(numberStr);
  9.                 sum += number;
  10.             } catch (NumberFormatException ignored) {
  11.             }
  12.         }
  13.         System.out.println(sum);
  14.     }
  15. }
  16.  
RAW Paste Data