iknowahra / cspiEdu

CSPI OJT
0 stars 0 forks source link

2021.09.23 교육내용 정리 #5

Open iknowahra opened 2 years ago

iknowahra commented 2 years ago

2021.09.23

for loop

for + control+space => 자동 완성

for(int  = 0; i < 10; i++) {
  System.out.println(i);
  // i = 0 으로 할지, i = 1 부터 할지 함께 정해야 한다. 
  // 보통 i = 0으로 하고, i+1 로 한다
  // 반복문을 보통 배열과 함께 쓰기 때문에 i = 0으로 할 때, 더 효율적인 면이 많다.
}

for loop + array

String [] strArr = {"cola", "cider", "juice"};
int [] priceArr = {1500, 1200, 1000};

for (int i = 0; i < strArr.length; i++) {
    System.out.printf("%s costs %d.%n", strArr[i], priceArr[i]);
}

for each

for(int price : priceArr) {
  System.out.println(price + "won");
}
// 자주 안쓰고 List를 주로 씀

control+f // 변수 찾고 변경 가능

block 지정 + control+f // 특정 부분 변수 찾고 변경

별 loop

for(int i = 0; i < 10; i++) {
  for(int j = 0; j < i+1; j++) {
    System.out.print("⭐️");
  }
   System.out.println("");
}

break : 반복문 자체에서 벗어난다.

continue : 그 횟수에서 벗어난다

🌱 별 찍는 것 과제

🤸‍♂️ 다음에는 spring boot X

spring

spring framework MVC pattern : 전자 정부 프레임 워크. 정부에서 표준으로 설정

spring boot X

Model : DB에 데이터 set을 담아 주는 것 and db connect

DB connect

View : frontend, 사용자에게 보여지는 부분 JSP, html

Controller : 사용자에게 요청을 받아서 결과값을 리턴해주는 곳

🎖 월요일 : Spring MVC pattern => DB MariaDB(MySQL)

🎖🎖 정보처리기사 check ✔️