
횟수에 따라 : for
값에따라 : while



.length : read only



코딩 테스트에서 많이 나옴 → 사용법 알고 있는게 좋아요

public class Main {
public static void main(String[] args) {
// == 연산자는 두 문자열의 주소(참조)값이 같은지 비교합니다. 다시 말해 두 객체가 메모리에서 동일한 위치를 가리키는지를 확인합니다.
String str1 = "strong"; //리터럴로 선언
String str2 = "strong";
String str3 = new String("strong"); //new 연산자로 선언
System.out.println(str1 == str2); //true
System.out.println(str1 == str3); //false
// equals() 메서드는 두 문자열의 내용을 비교합니다. 다시 말해, 두 문자열이 동일한 값을 가지고 있는지를 확인합니다.
String str1 = "strong";
String str2 = "strong";
String str3 = new String("strong");
System.out.println(str1.equals(str2)); //true
System.out.println(str1.equals(str3)); //true
}
}

⇒ return: 메서드를 빠져나감 → main()이 종료됨
⇒ break : 반복문 빠져나감
