일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | 2 | 3 | 4 | 5 | 6 | |
7 | 8 | 9 | 10 | 11 | 12 | 13 |
14 | 15 | 16 | 17 | 18 | 19 | 20 |
21 | 22 | 23 | 24 | 25 | 26 | 27 |
28 | 29 | 30 |
Tags
- Java
- HTML
- 프로그래머스
- 유니티
- SQL
- MySQL
- edwith
- 티스토리챌린지
- Eclipse
- 쿠키런킹덤공략
- 크리스마스
- 오블완
- 자바스크립트
- 쿠키런킹덤크리스마스
- 쿠킹덤
- JavaScript
- react
- 웹개발
- Unity
- 홀리데이익스프레스
- 딥러닝
- dart
- 이클립스
- oracle
- 자바
- 쿠키런킹덤
- Spring
- MERN
- programmers
- 개발자
Archives
- Today
- Total
Dev study and Repost
[dart] #16 #3.1 Named Parameters (08:54) 본문
반응형
String sayHello({String name = "NONE", int age = 0, String country = "NONE"}) {
return "Hello, $name, You are $age, and you come from $country";
}
String sayHelloRequired(
{required String name, required int age, required String country}) {
return "Hello, $name, You are $age, and you come from $country";
}
void main() {
print(sayHello(name: "lunch", age: 100, country: "Canada"));
//NULL SAFE
print(sayHello());
//required
print(sayHelloRequired(name: "required lunch", age: 100, country: "Canada"));
}
// PRINT
// >>>
// Hello, lunch, You are 100, and you come from Canada
// Hello, NONE, You are 0, and you come from NONE
// Hello, required lunch, You are 100, and you come from Canada
반응형
'IT INFO' 카테고리의 다른 글
[dart] #18 #3.4 QQ Operator (05:09) (0) | 2023.05.03 |
---|---|
[dart] #17 #3.3 Optional Positional Parameters (03:02) (0) | 2023.05.03 |
[dart] #15 add print comment #3.0 Defining a Function (04:15) (0) | 2023.05.02 |
[dart] #14 #3.0 Defining a Function (04:15) (0) | 2023.05.02 |
[dart] #13 #2.5 Sets (02:16) (0) | 2023.05.02 |
Comments