
void main() {
exam(["Java", "Gino"]);
exam([
"Alice",
"Bob",
"Carol",
"Dave",
"Ellen",
]);
}
void exam(List<String> names) {
StringBuffer buffer =StringBuffer('Hello');
for (int i = 0; i < names.length; i++) {
if (i == names.length - 1) {
buffer.write([names[i], '.'].join());
} else {
buffer.write([names[i], ' ,'].join());
}
}
print(buffer.toString());
}
StringBuffer buffer =StringBuffer('Hello');
buffer.write([names[i], '.'].join());
buffer.write([names[i], ' ,'].join());
print(buffer.toString());
void main() {
print(add(3, 5, 3));
print(add2(3, 5));
}
int add(int a, int b, [int c]) {
return a + b;
//[]안에 옵션 숫자를대입하지않아도 계산가능
}
int add2(int a, int b, [int c = 0, int d = 0, int e = 0]) {
return a + b + c + d + e;
//[옵션]숫자를 넣지않으면 계산이 불가능하지만 기본값을 주면 가능
}

void main() {
introduceOneSelf();
}
void introduceOneSelf() {
String name = '박경환';
int age = 17;
int a = 200;
String b = '남';
print('저는 $name이고 나이는 $age 키는${a}cm 성별은$b입니다');
}

void main() {
email('제목 없음', address: 'ghksdlajwu', text: '반갑습니다');
}
void email(String title, {String address, String text}) {
print('$address에 아래의 메일을 송신한다 \n제목 : $title \n본문 : $text ');
}

void main() {
email('제목 없음', address: 'ghksdlajwu', text: '반갑습니다');
}
void email(String title, {String address, String text}) {
print('$address에 아래의 메일을 송신한다 \n제목 : $title \n본문 : $text ');
}

void main() {
print(clacTriangleArea(bottom:2,height:2));
print(calcCircleArea(radius:3));
}
double clacTriangleArea({double bottom, double height}) {
return bottom * height / 2;
}
double calcCircleArea({double radius}) {
return radius * radius * 3.14;
}