일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | 2 | 3 | 4 | 5 | ||
6 | 7 | 8 | 9 | 10 | 11 | 12 |
13 | 14 | 15 | 16 | 17 | 18 | 19 |
20 | 21 | 22 | 23 | 24 | 25 | 26 |
27 | 28 | 29 | 30 | 31 |
- 인텔리제이
- 루프
- maven
- 메소드
- 싱글턴
- unboxing
- dependency
- 제네릭
- wrapper
- suvlet
- 자동형변환
- Java
- 싱글톤
- 클래스
- Jenkins
- 언박싱
- 빌드
- 컬렉션
- Scanner
- https://start.spring.io
- start.spring.io
- 박싱
- 내장객체
- boxing
- 무한
- Short
- 스프링
- 콜렉션
- 제너릭
- bootstrap
- Today
- Total
목록전체 글 (447)
Developer Gonie
* 오버라이딩 상속받은 메서드를 { } 안의 내용만 수정하는 것을 말한다. 오버로딩과 다르게 매개변수 타입, 개수는 절대 수정하지 않음. * 클래스의 상속은 좀 더 뒷 부분에서 나오지만 이를 설명하기 위해 미리 상속 코드를 가져왔다. 코드 class Sports{ String name; int inwon; Sports(){ name = "야구"; inwon = 9; } Sports(String name, int inwon){ this.name = name; this.inwon = inwon; } void display() { System.out.println(name); System.out.println(inwon); } } class Baseball extends Sports{ //String name..
* 메서드 오버로딩 같은 이름으로 매개변수의 '개수' 혹은 매개변수의 '타입'을 다르게 하여 상황에 맞게 사용할 수 있도록 한 메서드 선언방식 우리가 흔히 알고있는 println메서드도 오버로딩되어 있기 때문에 대부분의 데이터 타입에 대해 출력이 가능한 것이다. 코드 public class Ex05_12_overloading { public static void main(String[] args) { System.out.println(plus(3, 5, 10)); System.out.println(plus(3, 5)); System.out.println(plus(0.1f,0.2F)); System.out.println(plus(0.1,0.2)); } static int plus(int x, int y, ..
링크 : https://docs.oracle.com/en/java/javase/11/docs/api/index.html Java API에서 'Math' 클래스 검색예시 위의 정보를 토대로 한, 대략적인 Math 클래스 구조 - 문서에서 Field는 해당 클래스의 멤버변수, Method는 해당 클래스의 멤버함수 class Math { //FIELD : 해당 클래스의 멤버변수 static double E; static double PI; //Method : 해당 클래스의 멤버함수 static double abs(double a) { ; } } 내장 'Math' 클래스 사용 예시코드 - max 함수는 Math 클래스 내에 static으로 정의되어 있기 때문에 클래스명으로 바로 호출 가능. public clas..
https://gmlwjd9405.github.io/2018/09/21/rest-and-restful.html [Network] REST란? REST API란? RESTful이란? - Heee's Development Blog Step by step goes a long way. gmlwjd9405.github.io REST의 구체적인 개념 HTTP URI(Uniform Resource Identifier)를 통해 자원(Resource)을 명시하고, HTTP Method(POST, GET, PUT, DELETE)를 통해 해당 자원에 대한 CRUD Operation을 적용하는 것을 의미한다. 1. REST 구성 요소
* 재귀함수란? 자기가 자기 자신을 호출하는 것을 말함. 또한 함수는 return을 만나거나 마지막 괄호를 만나야 종료가 된다는 것을 고려하여 작성하면 좋음. 부메랑에 비유하면 부메랑이 돌아오려면 위와 같은 상황이 충족되어야 돌아올 수 있음. 코드 public class Ex05_08_재귀호출 { public static void main(String[] args) { show(3); } static void show(int cnt) { System.out.println("Hi~" + cnt); if(cnt == 1) return; show(--cnt); } } 실행결과 Hi~3 Hi~2 Hi~1 코드 public class Ex05_09_재귀호출 { public static void main(Strin..
* 매개변수로 배열을 넘길땐, 배열의 시작주소를 넘기는 것임. 참조변수는 배열의 시작주소를 담고있음. 코드 public class Ex05_06_배열넘기기 { public static void main(String[] args) { int[] arr = {1, 2, 3}; Ex05_06_배열넘기기 e = new Ex05_06_배열넘기기(); e.sub(arr); // 참조변수에는 주소가 담겨있는데 때문에 배열의 시작주소가 넘어감 } void sub(int[] x) { for(int t: x) { System.out.print(t+ " "); } } } 실행결과 1 2 3
* statc변수의 다른 이름은 클래스 변수이다. 객체가 생성되기 전부터 메모리에 올라가는 변수로, 같은 클래스로 객체를 여러개 생성하더라도 공유가 되어 아래와 같은 출력결과가 나오는 것이다. 코드 class Var{ static int a; // static 변수 int b; // instance변수 void increment() { int c=0; // 지역변수 a++; b++; c++; System.out.println("a:"+a); System.out.println("b:"+b); System.out.println("c:"+c); } }//Var public class Ex05_07_변수 { public static void main(String[] args) { Var v1 = new Var(..
* 클래스 내에서 멤버함수를 정의할 때, 앞의 'static'은 필요에 따라 있어도 되고, 없어도 되는데, 'static'을 붙이면 static변수(=클래스변수)와 동일하게 객체를 생성하기 전부터 메모리에 올라가 바로 클래스명으로 함수를 호출하는게 가능하다. 반대로, 만약 함수 정의시 'static'을 붙이지 않았다면 객체를 생성 후 객체를 통해 함수를 호출해야한다. * 위 원리로 컴파일될 때 객체를 만들지 않아도 main 함수가 호출될 수 있도록 static이 붙는 것임. * mian 함수 같은 "static 메서드는 static 메서드만 (바로) 호출할 수 있다." static이 아닌 메서드를 호출하고자 한다면 객체를 생성 후 호출해야 한다. Q. 첫번째 문제, 아래에서 뭐가 문제인지 찾고 올바른 수..
https://gmlwjd9405.github.io/2019/08/04/what-is-jpa.html [JPA] JPA란 - Heee's Development Blog Step by step goes a long way. gmlwjd9405.github.io https://livenow14.tistory.com/70 [DB] 하이버네이트(Hibernate)란? ORM 기술에 대한 명세인 JPA(Java Persistence API)의 구현체의 한 종류 JPA의 구현체이므로 JPA의 특징을 함께 정리했어요. Hibernate란? 하이버네이트는 자바 언어를 위한 ORM 프레임워크에요. JPA의 구현체 livenow14.tistory.com ORM 의 장점/단점 장점 -재사용성이 좋음 -쿼리 많이 몰라도 됨 ..
아래 예시는 이전 예시와 다르게 main함수가 포함된 클래스 내에서 멤버함수를 정의해서 사용하는게 아닌 그 밖의 클래스에서 멤버함수를 정의해서 사용하는 예시임. 코드 class Calculator { static int add(int x, int y) { return x + y; } static int sub(int x, int y) { return x - y; } int mul(int x, int y) { return x * y; } } public class Ex05_04_메서드 { public static void main(String[] args) { // main 메서드 정의 System.out.println("덧셈결과"+ Calculator.add(10, 20)); System.out.prin..
* 리턴타입이란? 함수작성할 때 함수명 왼쪽에 넣어주는 void, int, 등 * 매개변수(=파라미터) 함수 호출시 넘겨받은 인자를 담는 변수를 매개변수라고 함 * (전달)인자(=Argument) 함수 호출할때 넘겨주는 숫자 등 코드 public class Ex05_03_메서드 { public static void main(String[] args) { // main 메서드 정의 // static이 붙은 메서드는 바로 호출 가능 show(); add(3, 4); System.out.println("세 수의 뺄셈:" + sub(100, 11, 22)); // static이 붙지 않은 메서드는 객체를 생성후 호출가능 Ex05_03_메서드 e = new Ex05_03_메서드(); System.out.print..
* SPA프레임워크 (SPA Framework) 란? SPA(Single Page Apllication) - 단일 페이지 애플리케이션 서버로 부터 완전한 새로운 페이지를 불러오지 않고 현재의 페이지를 동적으로 다시 작성함으로써 사용자와 소통하는 웹 애플리케이션이나 웹사이트 [ 위키백과 ] 서버 호출이 적은 관계로 속도가 매우 빠르고 트래픽이 적다는 장점을 가짐 SPA프레임워크의 경우 개발 범위가 커짐에 따라 포인트가 많아지게 되었고 이로 인해 기존의 모놀리스방식(전체적인 개발 구성을 하나로 합쳐서 배포하는 방식)에서 마이크로서비스 방식으로 변화하는 추세가 나타났고 여기에 사용되어지는 것이 SPA프레임워크이다. Web Front-end 용 SPA프레임워크에는 Angular JS 나 Angular 2, Vu..