How to calculate average of marks in Java 8

In this example, we will see “How to calculate average of marks in Java 8?”. To achieve that, we are going to use Stream API introduced in Java 8 to find average and we will see it through several different ways.

Java 8 programs to calculate average of marks...!!! Click To Tweet

Example 1. Java 8 code to find average of marks using List

 

Output:

 

Example 2. Java 8 code to find average of marks using Array

 

Output:

Example 3. Java 8 code to find average of marks using Array with Scanner

 

Output:

 

Java 8 programs to calculate average of marks...!!! Click To Tweet

Do you like this Post? – then check my other helpful posts:

Other Useful References:

 

Related Posts:

[wcp-carousel id=”5342″]

Promotional Content:

Loading RSS Feed

Leave a Reply

Your email address will not be published.Required fields are marked *

Facebook Twitter Instagram YouTube