Skip to content

Instantly share code, notes, and snippets.

View Youssef-NaitSaid's full-sized avatar

Youssef Nait Said Youssef-NaitSaid

View GitHub Profile
@abdorah
abdorah / JavaFunctionalProgramming.md
Last active March 1, 2023 05:47
This article will teach you functional programming in java.

Java Functional Programming

This article will take you to the next level in java. Are you ready!

Introduction

This article is basically a set of examples of multiple tools provided by Java 8. Those tools have helped to make programming way more easier and optimal(even in terms of hardware resources), using a declarative approach. Hence, we don't have to tell many details, but only what we want to achieve by our code. I should highlight also the fact that this pack of tools is something that a java developer "must" know.

Map

/**
* Retrieves all the rows in the active spreadsheet that contain data and logs the
* values for each row.
* For more information on using the Spreadsheet API, see
* https://developers.google.com/apps-script/service_spreadsheet
*/
function readRows() {
var sheet = SpreadsheetApp.getActiveSheet();
var rows = sheet.getDataRange();
var numRows = rows.getNumRows();