"Java Programming: Arrays, Methods, and Stream API"

Main  Method 'main'

Step 1: This is the main method or starting point of the program.

Step 2: I declared StudentA as a array name and initialized their value value{100,98,..}.

Step 3: The 'Arraysum' Method is called with with StudentA and result will stored in the sum name as a integer.

Step 4: print the sum. 


'Arraysum' Method

Step 5: Arraysum method takes an array of integers int[] studentA  as a parameter and returns an integer.

Step 6: Iteration have started here , Instead for loop and used stream operation to reduce the lines and more readable.























































Comments

Popular posts from this blog

Swabbing Tow no's

Reversing the String ; Doubling Each Letter