App-Week1) dart 문법

gyu·2022년 12월 11일

app

목록 보기
2/7

dart 문법-java랑 별다를 거 없음

+화살표함수
함수속 코드가 간단한1줄이라면 화살표함수로 표현 가능

void main() {
 say() =>"Hello";
  print(say());
}

0) define the variable
datatype varName = value;

var initialize value로 datatype 선택
String? value로 문자 또는 null가능
const -declare var + initialize value가 같이 되어야함- 후에 변경불가
final - 선언하고 value를 나중에 담을 수 있고 한번 선언하면 변경불가

4) 클래스
property , method, constructor 로 구성되어있음
(method는 함수로, access modifier는 안쓰고 void or return type부터 씀)

profile
#TechExplorer 🚀 Curious coder exploring the tech world, documenting my programming journey in a learning journal

0개의 댓글