본문 바로가기

혼공

week3-java

기본미션 - 노트활용

 

  • 빠르게 읽으며 복습에 활용

 

 

 

 

chapter 10 - chapter 11

 

string

String str;

str = "Hello";
str += "World";

int idx = str.indexOf("World");    // (없으면 -1)
str = str.replace("Hello", "123"); // 123World
str = str.substring(0, 3);         // 123

String[] arr = str.split("");
str = String.join("", arr);         

for (char ch: str.toCharArray())
if  (str.equals("123"))

 

표준 라이브러리

long start = System.currentTimeMillis();
Thread.sleep(1000);

Date now = new Date();
SimpleDateFormat f = new SimpleDateFormat("MMdd");
System.out.println(f.format(now));

Calendar date = Calendar.getInstance();
System.out.println(date.get(Calendar.YEAR));

 

 

 

 

'혼공' 카테고리의 다른 글

week3-python  (0) 2023.07.23
week3-javascript  (0) 2023.07.18
week2-python  (0) 2023.07.16
week2-java  (0) 2023.07.15
week2-javascript  (0) 2023.07.13