java63 이것이 자바다 - 챕터3 연습 문제 3번 - 학생 1명의 연필 수와, 남은 연필 수 구하기int pencils = 534; int students = 30; int pencilsPerStudent = pencils / students; System.out.println(pencilsPerStudent); int pencilsLeft = pencils % students; System.out.println(pencilsLeft);4번 - 십의 자리 이하를 버리는 코드 만들기 (산술 연산자만 사용)int value = 356; System.out.println(value - value%100); 2025. 4. 5. 리트 코드 - 1768. Merge Strings Alternately 1768. Merge Strings AlternatelySolvedEasyTopicsCompaniesHintYou are given two strings word1 and word2. Merge the strings by adding letters in alternating order, starting with word1. If a string is longer than the other, append the additional letters onto the end of the merged string.Return the merged string.Example 1:Input: word1 = "abc", word2 = "pqr"Output: "apbqcr"Explanation: The merged stri.. 2025. 4. 5. 4/4 공부 기록 - 참조 타입, 클래스 객체 지향 프로그래밍참조 자료형대입을 해도 참조 값이 대입 된다.public static void main(String[] args) { //기본 자료형 int a = 10; int b = a; a = 11; System.out.println(b); 출력 : 10 // a의 값이 올바르게 바뀐 것으 ㄹ알 수 있다. //참조 자료형 int[] a1 = {1,2,3}; int[] b1 = a1; System.out.println(Arrays.toString(b1)); a1[0] = 4; System.out.println(Arrays.toString(b1)); 출력 [1, 2, 3] [4, 2, 3] // b1의 배열도 바뀌었다. }객체 비교는 =.. 2025. 4. 5. 4/3 - 변수, 조건문, 반복문 변수 초기화변수는 초기화하지 않아도 사용하지 않으면 에러는 나지 않음Object모든 타입 수용 가능모든 타입으로 형 변환 가능연산대입 연산복합 대입 연산피 연산자 연산자= 피 연산자ex) 1 += 2연산을 한 후의 값을 반영산술 연산컴퓨터는 소수점 연산을 기본적으로 못하므로 실수 연산의 경우 오차가 발생할 수 있음정수로 바꿔서 계산하고 (10 단위로 곱셈) 다시 나누는 방식으로 계산0으로 나눌 경우 예외 발생package ch03;public class Operate { public static void main(String[] args) { int score1 = 90; int score2 = 80; int score3 = 75; int total = score1 + score2 + score3.. 2025. 4. 5. 4/2 변수와 타입, 연산자 컴파일 언어 VS 인터프리터 언어컴파일 언어소스 → 컴파일 (컴파일러) → 기계어C, C++, …비교적 옛날 언어빠르다.실행 파일이 OS마다 달라짐 (리눅스, 윈도우 따로 실행)Java는 컴파일 언어가 아니다.인터프리터 언어소스 → 실행컴파일 과정 생략비교적 최신 언어느리다.플랫폼 종속성이 낮다. (OS 영향 없음)JavaScript, Python, …JIT (Just In Time)컴파일 언어의 장점 + 인터프리터 언어의 장점소스 → 바이너리 파일 → JVM 실행양쪽의 단점도 다 가지고 있다.컴파일 언어보다는 느리고, 인터프리터 언어보다는 빠르다.JDK자바 개발 도구JRE자바 실행 환경프로그램순서에 의해 나열주석주석은 바이너리 컴파일 제외// (행 주석)한 줄 주석 //System.out.printl.. 2025. 4. 5. 4/1 - 공부 기록, Java 시작하기 CS공통컴퓨터구조운영체제네트워크자료구조데이터베이스개별프로그래밍 언어프레임워크 / 라이브러리프로젝트 (포트폴리오)버전LanguageSpringBoot - Java JDK 11Spring - Java JDK 17자바 다운로드Oracle Java Technologies | OracleToolEclipse - 2023.03 ver이클립스 다운로드Eclipse Packages | The Eclipse Foundation - home to a global community, the Eclipse IDE, Jakarta EE and over 350 open source projects...컴퓨터 구조기본 구성CPU - 연산메모리저장장치입출력 장치하드웨어, 소프트웨어 상호작용운영체제운영체제 역할 (OS - Window.. 2025. 4. 5. 이전 1 ··· 6 7 8 9 10 11 다음 728x90 반응형