수업 서브노트

겨울조아·2023년 3월 14일
0

프로그래밍 입문 및 환경설정

프로그래밍 개념 이해

  • Program이란?

    해야 할 일을 미리 기술해 놓은 것

  • Programming?

    인간의 언어

    ↓ 번역(프로그래머)

    프로그래밍 언어 : C, C++, Java, Python, SQL, ..., HTML, ...

    ↓ 번역(software : compiler, interpreter, ...)

    기계어

========================================

Lesson: The Java Technology

About the Java Technology

https://docs.oracle.com/javase/tutorial/getStarted/intro/index.html

  • Java Technology - Java Programming Language
    - Java Platform - JVM
    - API

프로그래밍 환경 설정

  • Notepad++ 다운로드 및 설치

  • 환경 변수 이해 : where 명령, set 명령과 path 환경변수

  • Java 환경 설정

    ~ 프로그래밍 환경 설정.txt

    -> Adoptium JDK

    ~ https://en.wikipedia.org/wiki/Adoptium

    -> Eclipse 2022-12 (4.26)

    ~ workspace ≒ 폴더
    ~ project ≒ 폴더
    ~ package ≒ 폴더

Object-Oriented Programming Concepts

https://docs.oracle.com/javase/tutorial/java/concepts/index.html

  • What Is an Object?

  • What Is a Class?

    C:\Users\user> del Bicycle*

    C:\Users\user> notepad Bicycle.java
    C:\Users\user> javac Bicycle.java
    C:\Users\user> dir Bicycle*

    C:\Users\user> notepad BicycleDemo.java
    C:\Users\user> javac BicycleDemo.java
    C:\Users\user> dir Bicycle*

    C:\Users\user> java Bicycle -- 에러
    C:\Users\user> java BicycleDemo -- 성공

    • In object-oriented terms, we say that your bicycle is
      an instance of the class of objects known as bicycles.

    • 자바 코딩할 때 주의할 점

      -> 클래스명과 파일명은 반드시 일치해야 한다
      -> 파일 확장자는 반드시 .java로 끝나야 한다

    • 명명 규칙 : https://n-square.tistory.com/97

      -> 클래스 : PascalCase
      -> 변수 : camelCase
      -> 메소드 : camelCase

  • What Is Inheritance?

  • What Is an Interface?

  • What Is a Package?

  • What is a driver class? (Java)

    https://stackoverflow.com/questions/765751/what-is-a-driver-class-java

교재

코테 준비용 교재

Carriage Return, Line Feed에 대해서

https://www.explainthatstuff.com/typewriter.html

=====================================

Head First Java

목차

01장 자바 개요

- 할당 연산자와 비교 연산자 대비 

         C++, Java      Pascal, PL/SQL      Basic, PowerScript

  할당   a =  100       a := 100            a = 100
  비교   a == 100       a =  100            a = 100

- Control Flow Statements

  https://docs.oracle.com/javase/tutorial/java/nutsandbolts/flow.html
  https://docs.oracle.com/javase/tutorial/java/nutsandbolts/QandE/questions_flow.html

  -> decision-making statements : if, switch  

     - hashing is ____! 
     - https://aahc.tistory.com/6

  -> looping   statements       : for, while, do-while
  -> branching statements       : break, continue, return

- Math.random()
  https://docs.oracle.com/javase/8/docs/api/java/lang/Math.html

  cf.Pseudo Random and True Random

     https://www.w3schools.com/python/numpy/numpy_random.asp

02장 스토리 기반 객체 지향 프로그래밍 이해

- 상속, 오버라이딩, 다형성, 추상 클래스, ...
- Guessing Game

03장 변수 : Primative vs Reference

- Variables

  https://docs.oracle.com/javase/tutorial/java/nutsandbolts/variables.html

  - Primative data type : byte, short, int, long, float, double, char, boolean 
  - Reference data type : Class, Interface, Array, Enum

- Variables

  - Instance Variables (Non-Static Fields|Variables, 필드)
  - Class Variables    (Static     Fields|Variables, 정적 필드)
  - Local Variables
  - Parameters 

04장 메소드와 인스턴스 변수

- Methods use Instance variables   
- Encapsulation, Getters, Setters

- String 클래스 : == vs equals  -> https://coding-factory.tistory.com/536

05장 메소드 : 게임 프로그래밍

- eXtreme Programming 방법론
- High-level design -> prep code -> test code -> real code 

06장 자바 라이브러리 : 게임 프로그래밍

- ArrayList 클래스 

** Array 

   https://docs.oracle.com/javase/tutorial/java/nutsandbolts/arrays.html

07장 상속, 다형성

- Inheritance

  - provides a powerful and natural mechanism 
    for organizing and structuring your software
  - avoids duplicate code
  - defines a common protocol for a group of classes
  - enables use of polymorphism

- Polymorphism : 상위 타입(클래스 혹은 인터페이스)의 참조 변수로 하위 타입의 모든 객체를 참조할 수 있다.

- Overriding vs Overloading

08장 다형성, 인터페이스

- abstract class, abstract method
- Object class, Casting
- interface 

  -> Default Method, Static Method

     - https://atoz-develop.tistory.com/entry/JAVA-8-interface-default-키워드와-static-메소드
     - http://kbs0327.github.io/blog/technology/java8-default-interface/
     - https://docs.oracle.com/javase/tutorial/java/IandI/defaultmethods.html

- Head First Design Pattern 

  -> 1장 Strategy pattern, 2장 Observer pattern, ...
  
  -> 과제 : Strategy pattern을 적용한 프로그램을 작성해서 보내주세요

09장 생성자, 가비지 컬렉션

- Stack, Heap 메모리
- Constructor 

10장 Static, Wrapper Class

- Math, Integer, Character, ..., String, Calendar, ...

11장 Exception Handling

- Logic Error 
- 일반 예외(Exception)         = Syntax  Error 
- 실행 예외(Runtime Exception) = Runtime Error 

  -> https://mozi.tistory.com/550
  -> https://www.w3schools.com/java/java_try_catch.asp 

12장 Swing 1 -> AWT, Swing ... JavaFX
13장 Swing 2 -> BeatBox.java
14장 I/O
15장 Networking and Multithread
16장 Data Structures: Collections Framework and Generics
17장 Deployment -> package 이해
18장 Distributed Computing

getter, setter 등 작성

  • 직접 작성

  • Eclipse 코드 자동 완성

  • Lombok 활용 : https://advenoh.tistory.com/24

    (0) Lombok 다운로드 및 임의의 폴더에 붙여넣기

    https://projectlombok.org/download
    
    프로젝트 폴더 아래 임의의 폴더(예를 들어 lib)를 생성한 뒤 lombok.jar 붙여넣기

    (1) 프로젝트에 Lombok 클래스패스 설정

    프로젝트 이름 우클릭 -> Build Path -> Configure Build Path... -> Libraries -> (Classpath) -> Add JARs -> lombok.jar 찾아서 선택

    (2) Enable lombok for Eclipse

    https://www.vogella.com/tutorials/Lombok/article.html
    
    lombok.jar 파일이 있는 곳에서 실행 : java -jar lombok.jar
    
      -> Can't find IDE 경고창 확인 클릭
      -> Specify location에서 eclipse 폴더 설정
      -> Install/Update 클릭
      -> Quit Installer 클릭
    
    참고.lombok 삭제
    
         https://standard-stereotype.tistory.com/2
    
    참고.Eclipse 2021-06에서 lombok 에러 해결 방법
    
         https://shanepark.tistory.com/205

    (3) Eclipse 재시작 및 "Lombok 활용 프로젝트 rebuild"

    https://dololak.tistory.com/63

    (4) 연습

    -----------------------
    > ElectricGuitar.java <
    -----------------------
    
    	import lombok.Data;
    	
    	@Data
    	public class ElectricGuitar {
    		private String brand = "야마하";
    		private int numOfPickups;
    		private boolean rockStarUsesIt;
    	}
    
    ---------------------------
    > ElectricGuitarMain.java <
    ---------------------------
    
    	public class ElectricGuitarMain {
    	
    		public static void main(String[] args) {
    			ElectricGuitar guitar = new ElectricGuitar();
    			guitar.setBrand("야마하");
    			System.out.println(guitar.getBrand());
    			System.out.println(guitar.toString());  // 객체의 현재 state 확인!
    			System.out.println(guitar);
    		}
    	
    	}

=========================================

초보자를 위한 Java Programming

Enum type

Generics

** generic type = parameterized type

https://docs.oracle.com/javase/tutorial/java/generics/index.html
https://www.geeksforgeeks.org/generics-in-java/

  • Type : Class, Interface, Enum

  • Formal parameter vs Actual Argument
    Type parameter vs Type Argument
    (Type variable)

  • Bounded Type Parameter

  • Upper Bounded Wildcards
    Unbounded Wildcards
    Lower Bounded Wildcards

    -> 다음 두가지는 같은 것임

    • public void takeThing(ArrayList list)

    • public void takeThing(ArrayList<? extends Animal> list)

    • public void takeThing(ArrayList one, ArrayList two)

    • public void takeThing(ArrayList<? extends Animal> one, ArrayList<? extends Animal> two)

  • Type Erasure

    https://darkstart.tistory.com/283

  • relatively prime(서로소)

    https://cleancode-ws.tistory.com/115

컬렉션s 프레임워크

https://docs.oracle.com/javase/tutorial/collections/index.html
https://velog.io/@jakeseo_me/이것이-자바다-정리-15-컬렉션-프레임워크

Nested Classes

https://docs.oracle.com/javase/tutorial/java/javaOO/nested.html

스트림(Aggregate Operations)의 특징

입출력 스트림

스레드

https://docs.oracle.com/javase/tutorial/essential/concurrency/index.html

=====================

부록

UML

  • UML_서브노트.txt

Class (Relationships) Diagram

  • 클래스 다이어그램.txt
  • 클래스 다이어그램.pdf

SOLID Design Principles

-> https://victorydntmd.tistory.com/291
-> https://m.blog.naver.com/ljh0326s/221113248565

객체지향(OOP) 개념

https://effectiveprogramming.tistory.com/category/3.객체지향%28OOP%29%20개념

========================

Java 연습 문제

Java Examples

https://www.programiz.com/java-programming/examples

이것이 자바다 연습문제 풀이

이것이 자바다개정판확인문제+정답.pdf

자바의 정석 연습문제(약 200문제)

https://codechobo.tistory.com/1

Collections in Java

https://www.geeksforgeeks.org/collections-in-java-2/

JAVA의 HashMap, HashTable

https://swalloow.tistory.com/40

코딩테스트 연습

https://programmers.co.kr/learn/challenges

=================================

JDBC

  • JDBC 서브노트.txt

0개의 댓글