MapleStory Finger Point
[URECA] DAY15 자바
·
💡 URECA
스택LIFO 구조(마지막에 들어온게 처음 나옴)Last In First OUT엘베타기 상수는 데이터를 갖을 수 있다. 하지만 static이어야한다. interface data 조건: public statie final시스템 스택은 제어할 수 없다..package collections2;import java.util.Stack;public class StackTest { public static void main(String[] args) { // Stack instance 생성 Stack stack = new Stack(); // 요소 추가 stack.push("첫 번째"); stack.push("두 번째"); stack.push("세 번째"); System.out.println("현..
[URECA] 프로그래머스 | 기초 | Java
·
💡 URECA/⌨️ 프로그래머스
1. 문자열을 정수로 변환하기class Solution { public int solution(String n_str) { return Integer.parseInt(n_str); }} 문자열을 정수로 바꾸는 2가지 방법1. Integer.parseInt( ) 2. Interger.valueOf( )  2. 문자열 정수의 합class Solution { public int solution(String num_str) { int answer = 0; String[] new_str= num_str.split(""); for(int i = 0; i  String[ ] -> 문자열 배열 의미 String[] arr = {"apple..
[URECA] 프로그래머스 | 입문 | JS
·
💡 URECA/⌨️ 프로그래머스
1. 두 수의 곱function solution(num1, num2) { var answer = num1 * num2; return answer;} 2. 두 수의 차function solution(num1, num2) { var answer = num1 - num2; return answer;} 3. 숫자 비교하기function solution(num1, num2) { if (num1 == num2){ return 1; } else{ return -1; }} 4. 나이 출력function solution(age) { let answer = 2022 - age + 1 return answer;} 5. 나머지 구하기function..
[URECA] DAY14 | 자바(5) 재귀
·
💡 URECA/🗒️ 스터디 노트
1부터 n까지 루프 없이 출력해라package recur;public class test { public static void main(String[] args) { int n = 10; printNos(n); } public static void printNos(int n) { if(n>0) { printNos(n-1); } System.out.print(n + " "); } } 별도의 메서드로 분리해 자신의 메서드(public static void printNos(int n))를 계속 호출함  만약에 integer였다면 정수형태라고 표현했더라도 객체이다. n에 있는 주소값이 같이 만들어진다. 이거를 copy of reference (copy를 pass라고도 한다. pass by) 이동..
[URECA] Day 13 | 자바(5) | 컬렉션 API(ArrayList, HashSet, TreeSet, HashMap) 재귀
·
💡 URECA
Comparable: 비교할 수 있는Comparator: 비교자package generic;import java.awt.Button;import java.util.ArrayList;import java.util.Comparator;public class Test { public static void main(String[] args) { int []arr1= {1,2,3}; // homogeneous collection String []arr2= {"hello","hi","bye"};// homogeneous collection Object []arr3= new Object[3];//heterogeneous collection arr3[0]="hello"; arr3[1]=new Test(); ..
[URECA] DAY 12 | 자바(4)
·
💡 URECA
인터페이스는 계열에 가깝다. String (Java Platform SE 8 ) String (Java Platform SE 8 )Compares two strings lexicographically. The comparison is based on the Unicode value of each character in the strings. The character sequence represented by this String object is compared lexicographically to the character sequence represented by the argumdocs.oracle.com Serializable계열                                  clien..
[URECA] DAY11 | 자바(3)
·
💡 URECA
실제 분야에서는 공간복잡도가 중요한 경우가 다수있다.자바는 타입을 항상 앞에 둔다. String[] cars; 배열 2가지 타입- primitive: 숫자 단위 논리 8개 - reference: 위의 8개의 제외한 나머지들, class, intereface, enum, [ ]배열자체가 reference데이터고 instance(객체)영역에 있다. (이름 옆에 값이 못온다.)package array;public class Test { public static void main(String[] args) { // 배열도 참조 데이터 형태이다. // 선언 = 생성 {초기화} String[] cars = {"Volvo", "BMW", "Ford", "Mazda"}; //할당 연산자가 없어 이름만 저장 Sy..
[URECA] DAY 10 | 자바(2)
·
💡 URECA
자바에서는 ;(세미콜론) 완전 필수에러 메시지는 많이 읽어보는게 좋다. package com.ysh.basic; import java.sql.Date; public class MyProfile{ public static void main(String[] args ) { int age = 30; double tall = 160.5; char gender = '여'; boolean isPretty = true; MyStr name = new MyStr(); // MyDate birthday = new MyDate(); // String name = new String("양세현"); Date birthday = new Date(2001, 10, 3); ..
[URECA] Day09 | 자바(1)
·
💡 URECA
Java의 목표 (개발자 편의성)1. WORA(write one run away)                                                    여기까지 개발과정 |                                                  인터프리팅.java(source code) ---compile---> .class(byte code)   ------ 실시간 코드 변환 --------->  🖥️                                                      중간 단계 코드      ------- 실시간 코드 변환 ---------> 🖥️                                                 ..