본문 바로가기

ONLINE COURSES25

인프런 자바기초강의_List, Map, 예외처리, 입출력, 25강. Collections 25-1. List - 인터페이스로, 이를 구현한 클래스는 인덱스를 이용해서 데이터를 관리한다. # 특징 - 인덱스를 이용함 - 데이터 중복이 가능함 //ArrayList 객체생성 ArrayList list = new ArrayList(); // 데이터 추가 list.add("Hello"); list.add("Java"); list.add("World"); // Hello Java World list.add(2,"programming"); // Hello Java Programming World list.set(1,"c"); // 인덱스1에 있는 데이터를 "c"로 바꿈 // Hello C Programming World // 데이터 추출 String str = list.ge.. 2021. 8. 15.
인프런 자바기초강의_인터페이스, 추상클래스, 람다식 21강. 인터페이스 21-1. 인터페이스란? - 클래스와 달리, 객체를 생성할 수는 없다. - 클래스에서 구현해야 하는 작업명세서이다. 21-2. 인터페이스를 사용하는 이유 - 인터페이스를 사용하는 이유는 많지만, 가장 큰 이유는 객체가 다양한 자료형(타입)을 가질 수 있기 때문이다. 21-3. 인터페이스 구현 - class 대신 interface 키워드를 사용하며, extends 대신 implements키워드를 이용한다. - 메서드를 선언만하지, 정의는 하지 않는다. public void funA( ); 까지만. ( aka 추상메서드) ==> 선언된 메서드는 이를 활용하는 class에서 별도로 정의된다. public class 클래스이름 implements 인터페이스이름1, 이름2... {...} # .. 2021. 7. 30.
인프런 자바기초강의_15,16,17,18,19,20강 15강. 생성자, 소멸자, this 15-1. 디폴트 생성자 15-2. 사용자 정의 생성자 객체 GC에 의해서 메모리에서 제거될 때 finalize()메서드가 호출된다. 15-3. 소멸자 15-4. this : 현재 객체를 가리킴 16강. 패키지와 static 16-1. 패키지 : 수많은 클래스를 폴더 형식으로 관리하는 것. # 패키지 이름 결정 요령 -- 패키지 이름은 패키지에 속해있는 클래스가 최대한 다른 클래스와 중복되는 것을 방지하도록 만든다. -- 패키지 이름은 일반적으로 도메인을 거꾸로 이용한다, -- 개발 중에 패키지의 이름과 구조는 변경될 수 있다.클래스도 이동 가능함. -- 패키지 이름만 보고도 해당 패키지 안에 있는 클래스가 어떤 속성과 기능을 가지고 있는 예상이 될 수 있도록 이름을 .. 2021. 7. 25.
인프런 자바기초강의_9,10,11,12,13강 9강. 조건문 9-1 if -> 양자택일 9-2 switch -> 다자택일 switch(변수명) { case 조건1: System.out.println("조건1"); break; case 조건2: System.out.println("조건2"); break; case 조건3: System.out.println("조건3"); break; default; break; } 10강. 반복문 10-1. for문 # input값을 받아 구구단 출력하기 System.out.print("곱하고 싶은 값을 입력하세요-> "); Scanner scanner = new Scanner(System.in); int inputNum = scanner.nextInt(); for(i=1;i 'NullPointerException' 이.. 2021. 7. 17.
인프런 자바기초강의_5,6,7,8강 0. 형 변환 1. 자동적 형변환 (묵시적 형변환) : 작은 공간의 메모리에서 큰 공간의 메모리로 이동. 2. 명시적 형변환 : 큰 공간의 메모리에서 작은 공간의 메모리로 이동. => 명시해줘야 성립한다. int iVar = 100; byte bVar = (byte)iVar; * 명시적 형 변환은 데이터가 누실될 수 있다. 따라서 주로 처음부터 int, double 등 큰 자료형을 사용한다. 5강 5-2 서식문자 : 일반 문자가 아닌 서식에 사용되는 문자 System.out.println("오늘의 기온은 10도 입니다."); System.out.printf("오늘의 기온은 %d도 입니다.\n", 10); int num1 = 20; System.out.println("오늘의 기온은 " + num1 + "도.. 2021. 7. 15.
FreeCodeCamp_JS_TIL_DAY3 0. use destructuring assignment to extract values from objects. : neatly assigning values taken directly from an object. 1. use destructuring assignment to assign values from objects. : allows you to assign a new variable name when extracting values. do this by putting the name after a colon when assigning the value. const user = {name:'sam lee', age:30}; const {name:userName, age:userAge} = use.. 2021. 7. 5.
FreeCodeCamp_JS_TIL_DAY2 1. operator > does convert data types of values while comparing. 2. switch if you have many options to choose from, use a swith statement. a switch statement tests a value and can have many case statements which define various possible values. statements are eeuted from the first matched case values until a break is encountered. case - 한번에 여러개를 쓸 수 있음. default - 해당하는 case 가 없는 경우 default에 저장된 내용.. 2021. 6. 26.
FreeCodeCamp_JS_TIL_DAY1 1. Escaping quotes Quotes are not the only characters that can be escaped inside a string. there are two reasons to use escaping characters. 1. to allow you to use characters you may not otherwise be able to type out, such as carriage return. 2. to allow you to represent multiple quotes in a string without javascript misinterpreting what you mean. code output \' single quote \" double quote \\ b.. 2021. 6. 23.
DOM-3 0. classses and attribute ////classes and attribute const firstli = document.querySelector('li:first-child'); const link = firstli.children[0]; //엑스자표시 let val; //classes val = link.className; val = link.classList; val = link.classList[0]; link.classList.add('test'); link.classList.remove('test'); val = link; //attribute val = link.getAttribute('href'); val = link.setAttribute('href', 'http://go.. 2021. 6. 15.