Notice: This page requires JavaScript to function properly.
Please enable JavaScript in your browser settings or update your browser.
Impara Challenge: Fill an Array | Arrays
Introduction to Scala
course content

Contenuti del Corso

Introduction to Scala

Introduction to Scala

1. Getting Started
2. Variables and Data Types
3. Conditional Statements and Loops
4. Arrays
5. Strings

book
Challenge: Fill an Array

Task

Your task is to create an array of integers of size 20 named testArray and fill it with numbers from 1 to 20 inclusive using a for loop with the loop variable named i to iterate over its indices in a concise way.

java

Main

copy
12345678
object Main { def main(args: Array[String]): Unit = { var ___ = new ___[___](___) // Declare an array variable for (___ ___ testArray.___) { ___(___) = ___ // Fill the array } } }

Tutto è chiaro?

Come possiamo migliorarlo?

Grazie per i tuoi commenti!

Sezione 4. Capitolo 3

Chieda ad AI

expand
ChatGPT

Chieda pure quello che desidera o provi una delle domande suggerite per iniziare la nostra conversazione

course content

Contenuti del Corso

Introduction to Scala

Introduction to Scala

1. Getting Started
2. Variables and Data Types
3. Conditional Statements and Loops
4. Arrays
5. Strings

book
Challenge: Fill an Array

Task

Your task is to create an array of integers of size 20 named testArray and fill it with numbers from 1 to 20 inclusive using a for loop with the loop variable named i to iterate over its indices in a concise way.

java

Main

copy
12345678
object Main { def main(args: Array[String]): Unit = { var ___ = new ___[___](___) // Declare an array variable for (___ ___ testArray.___) { ___(___) = ___ // Fill the array } } }

Tutto è chiaro?

Come possiamo migliorarlo?

Grazie per i tuoi commenti!

Sezione 4. Capitolo 3
Siamo spiacenti che qualcosa sia andato storto. Cosa è successo?
some-alt