Skip to content

Commit

Permalink
Day092
Browse files Browse the repository at this point in the history
  • Loading branch information
hbelmiro committed Aug 19, 2021
1 parent e2c5951 commit f7dd7eb
Show file tree
Hide file tree
Showing 4 changed files with 53 additions and 0 deletions.
19 changes: 19 additions & 0 deletions README.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -3497,4 +3497,23 @@ public class Day091 {
System.out.println(distinctElementsList);
}
}
----

== Day 92 - Summing the elements of a `List`.
[source,java]
----
package com.thegreatapi.ahundreddaysofjava.day092;
import java.util.List;
public class Day092 {
public static void main(String[] args) {
List<Integer> integers = List.of(1, 2, 3, 4, 5);
Integer sum = integers.stream().mapToInt(Integer::intValue).sum();
System.out.println(sum);
}
}
----
19 changes: 19 additions & 0 deletions days/day092/pom.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<parent>
<artifactId>days</artifactId>
<groupId>com.thegreatapi.100daysofjava</groupId>
<version>1.0-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>

<artifactId>day092</artifactId>

<properties>
<maven.compiler.source>16</maven.compiler.source>
<maven.compiler.target>16</maven.compiler.target>
</properties>

</project>
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
package com.thegreatapi.ahundreddaysofjava.day092;

import java.util.List;

public class Day092 {

public static void main(String[] args) {
List<Integer> integers = List.of(1, 2, 3, 4, 5);

Integer sum = integers.stream().mapToInt(Integer::intValue).sum();

System.out.println(sum);
}
}
1 change: 1 addition & 0 deletions days/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,7 @@
<module>day089</module>
<module>day090</module>
<module>day091</module>
<module>day092</module>
</modules>

</project>

0 comments on commit f7dd7eb

Please sign in to comment.