목록All Contents (143)
Code&Data Insights
[ Interface ] : 보안을 위해 interface를 사용한다. ( 특정한 디테일을 숨기고, object의 중요한 디테일만을 보여준다 ) - 인터페이스는 인터페이스로만 상속받을 수 있으며, 클래스와 달리 다중상속을 받는 것이 가능하다 - 추상( abstract) 클래스와 같이 인터페이스는 objects를 생성하는데 쓰일 수 없다. - interface 메소드는 body가 존재하지 X, body는 implement class에서 작성되어진다. - On implementation of an interface, you must override all of its methods - Interface methods are by default, abstract and public - Interface att..
[ Thread ] - 한 프로세스 내에서 멀티 태스킹을 할 수 있도록 만들어진 프로세스를 스레드(Thread)라고 하며, 멀티 태스킹이 가능한 이유는 Multi Thread 때문이다. - A thread of execution in a program ( kind of like a virtual CPU ) - The JVM allows an application to have multiple threads running concurrently - Each thread can execute parts of your code in parallel with the main thread * Each thread has a priority ( 모든 쓰레드에는 각각 우선순위가 있다 ) -> Threads with ..
[ Generic ] : 클래스 내부에서 지정하는 것이 아닌 외부에서 사용자에 의해 지정되는 것. : 컬렉션 프레임 워크에서 많이 사용되어짐 - Generics add that type of safety feature. - Generics are used in HashSet / ArrayList / HashMap - The syntax of generic * To create an instance of generic class * BaseType obj = new BaseType () * We cannot use primitive data types like int, char - Type Parameters in Java Generics -> T : Type -> E : Element -> K : Key..
* Java.lang .objects method : equals / toString() / clone() * Object class - 모든 클래스의 최상위 클래스 - java.lang.Object - 모든 클래스는 object 클래스의 method를 사용할 수 있음 *Hashcode - return : jvm(java virtual machine)이 저장한 인스턴스의 주소값을 10진수로 나타냄 - 서로다른 메모리의 두 인스턴스가 같다면? : equals() - true : 동일한 hashcode() return 값을 가져야함.
Instance - 인스턴스는 객체에 포함 - OOP(object oriented programming)의 관점에서 객체가 메모리에 할당되어 실제 사용될 때 '인스턴스'라고 부름 Static Variables ( static 변수 ) - static 변수는 인스턴스가 생성될 때 마다 다른 메모리를 가지는 것이 아니라 프로그램이 메모리에 적재(load)될 때 데이터 영역의 메모리에 생성됨 - 따라서, 인스턴스의 생성과 관계없이 클래스 이름으로 직접 참조 함 - static 변수 = 클래스 변수 ( 인스턴스 변수 = 멤버변수 ) [ArrayList vs Array ] * Array - Fixed Length를 먼저 선언함 -> size 변경 불가 - 연속된 자료구조 ( 인덱스 값이 비어있으면 X ) - ge..
2022.01.31 # 1. Stage 9 - [ 3009 ] [3009] - 네번째 점 # 2. Stage 9 - [ 1085 ] [1085] - 직사각형에서 탈출
2022.01.28 # Lab 1 - 클래스, 인스턴트 생성 Q) (1) Matching 클래스 만들기 attributes - String firstWord / String secondWord / Int count (2) constructors와 method 생성하기 - private void match() method : firstWord와 secondWord에 담긴 공통 글자수 세기, count attribute 수정 이 method는 모든 constructors에서 부를 수 있어야 한다. - default constructor : firstWord&secondWord = null / count = 0 로 세팅한다 - copy constructor - constructor : 3 arguments를 ..
2022.01.27 # Stage 10 브루트 포스 - [2798] 브루트 포스 알고리즘은 주로 비밀번호를 해킹할 때 쓰이며, 주어진 숫자나 리스트의 모든 경우의 수를 고려해 될때까지 시도해 보는 방식이다. [ 2798 ] - 블랙잭 [ my code ] combinations(리스트, 인자값) combinations()는 리스트 내의 모든 조합을 나타낸다. ++ from itertools import permutations 하나의 리스트에서 모든 순열 from itertools import combinations 하나의 리스트에서 모든 조합 from itertools import product 두개 이상의 리스트에서 모든 조합