본문 바로가기

TIL141

23.05.02 continue package nadocoding.Chap_04; public class _11_Continue { public static void main(String[] args) { // Continue // 치킨 주문 손님중에 노쇼 손님이 있다고 가정 // For int max = 20; int sold = 0; int noShow = 17; for (int i = 1; i 2023. 5. 2.
23.05.01 문자열 관련 함수(.length(), .indexOf(), .substring(), ...) package nadocoding.Chap_03; public class _01_String1 { public static void main(String[] args) { String s = "I like Java and Python and C."; System.out.println(s); // 문자열의 길이 System.out.println(s.length()); // 29 // 대소문자 변환 System.out.println(s.toUpperCase()); // I LIKE JAVA AND PYTHON AND C. System.out.println(s.toLowerCase()); // i like java a.. 2023. 5. 1.
23.04.28 연산자 package nadocoding.Chap_02; public class _01_Operator1 { public static void main(String[] args) { // 산술 연산자 // 일반 연산 System.out.println(4 + 2); // 6 System.out.println(4 - 2); // 2 System.out.println(4 * 2); // 8 System.out.println(4 / 2); // 2 System.out.println(5 / 2); // 2 System.out.println(2 / 4); // 0 System.out.println(4 % 2); // 0 System.out.println(5 % 2); // 1 // 우선 순위 연산 System.ou.. 2023. 4. 28.
23.04.27 JAVA 활용 강의를 이어나가기 위해서 기본을 다져야 한다고 생각, 기본 강의를 다시 돌아보기로 했다. 공부 내용은 코드 내에 주석으로 첨부 문자열 public class _01_HelloWorld { public static void main (String[] args) { System.out.println("119"); } } public class _02_DataTypes { public static void main(String[] args) { System.out.println("Hello World!"); System.out.println("안녕하세요?"); System.out.println(12); System.out.println(-12); System.out.println(3.14); S.. 2023. 4. 27.