To declare an array of strings with space for ten
values, we would make the variable, and give it a
type of string array, and an initial value of a
new string array with space for ten items. To declare
an array of strings that contains two values, yes and
no, we'll use the curly brace notation. The type is
the same as before, but now we put the strings,
yes and no, in the curly braces separated by commas.
Para declarar un «array» de cadenas con espacio para diez
valores, haríamos la variable y le daríamos un
tipo de «array» de cadena, y un valor inicial de un
nuevo «array» de cadena con espacio para diez artículos. Con el fin de declarar
un «array» de cadenas que contiene dos valores, sí y
no, vamos a utilizar la anotación corchete. El tipo es
el mismo que el anterior, pero ahora ponemos las cadenas,
sí y no, en las llaves separadas mediante comas.
Pour déclarer un tableau de chaînes
avec un espace pour dix valeurs,
nous ferions la variable
et lui donnerions un type
de tableau de chaînes
ainsi qu'une valeur initiale
d'un nouveau tableau de chaînes
avec de l'espace pour dix éléments.
Pour déclarer un tableau
de chaînes contenant deux valeurs,
oui et non, nous utiliserons
la notation accolade.
Le type est comme avant,
mais nous mettons les chaînes,
oui et non, dans les accolades
séparées par des virgules.
10個の値の空間のある文字列の
配列を宣言するには変数を作り
文字列の配列の型と10個の項目の空間のある
新しい文字列の配列の初期値を与えます
“yes”と“no”の2つの値を含む文字列の
配列を宣言するには波括弧表記を使います
型は前と同じですが波括弧の中に
文字列“yes”と“no”をコンマで分けて入れます
10개의 인덱스를 갖는
문자열 배열을 만들려면, 자료형 String을
주고 변수명을 지은 후에
new String[배열의 개수]로 선언하면 됩니다.
두 개의 값을 저장하고 있는 문자열을 선언하려면,
중괄호를 이용해야 합니다. 자료형은 전과
같지만, yes와 no를 중괄호 안에
넣으면 됩니다. 콤마로 구분을 꼭 지어야 합니다.