본문 바로가기

728x90

그 땐 Programming Languages했지

(11)
[self-study/생활코딩] | ① 인터페이스의 형식 ② 다형성 참고자료: Youtube - 생활코딩 JAVA1 수업 소개 //인터페이스로 형태를 규제한다. interface Calculable { int sum(int v1, int v2); } //인터페이스 형태대로 클래스를 생성한다. class RealCal implements Calculable { public int sum(int v1, int v2) { return v1 + v2; } } //인터페이스 형태대로 클래스를 생성한다. class DummyCal implements Calculable { public int sum(int v1, int v2) { return 3; } } public class InterfaceApp { public static void main(String[] args) { Du..
[self-study/생활코딩] 객체지향프로그래밍(OOP) | ①클래스&인스턴스 ②변수와 메소드 ③클래스 ④인스턴스 ⑤static ⑥생성자와 this 참고자료: Youtube - 생활코딩 JAVA1 남의 클래스 & 남의 인스턴스 import java.io.FileWriter; import java.io.IOException; public class OthersOOP { public static void main(String[] args) throws IOException { //class: System, Math, FileWriter //instance: f1, f2 System.out.println(Math.PI); System.out.println(Math.floor(1.8)); System.out.println(Math.ceil(1.8)); FileWriter f1 = new FileWriter("data.txt"); f1.write("Hello..
[self-study/생활코딩] Ch14.나의 앱 만들기(2) | ① 오리엔테이션2 ② 조건문 ③ 배열 ④ 반복문 ⑤ 메소드 ⑥ 클래스 ⑦ 인스턴스 참고자료: Youtube - 생활코딩 JAVA1 조건문 double dividend1; double dividend2; double dividend3; if(income > 10000.0) { dividend1 = income*0.5; dividend2 = income*0.3; dividend3 = income*0.2; } else { dividend1 = income*1.0; dividend2 = income*0; dividend3 = income*0; } 📌수입이 만 원 이상인지 파악해 배당을 다르게 해보자 배열 //double형 데이터 3개를 담을 수 있는 배열을 만들었다! double[] dividendRates = new double[3]; dividendRates[0] = 0.5; divide..
[self-study/생활코딩] Ch14.나의 앱 만들기(1) | ① 오리엔테이션 ② 기본 기능 구현 ③ 변수 도입 ④ 입력값 도입 참고자료: Youtube - 생활코딩 JAVA1 기본 기능 구현 public class AccountingApp { public static void main(String[] args) { System.out.println("Value of Supply : " + 12345.0); System.out.println("VAT : " + (12345.0*0.1)); System.out.println("Total : " + (12345.0 + 12345.0*0.1)); System.out.println("Expense : " + (12345.0*0.3)); System.out.println("Income : " + (12345.0 - 12345.0*0.3)); System.out.println("Dividen..
[self-study/생활코딩] Ch12.직접 컴파일하고 실행하기 | Ch13.자바 문서 보는 법 | ① API vs UI ② 패키지, 클래스, 변수, 메소드 ③ 클래스 ④ 인스턴스 ⑤ 상속 참고자료: Youtube - 생활코딩 JAVA1 컴파일과 실행하기 Compile - 자바 확장자가 붙은 소스코드를 클래스 확장자가 붙은 소스코드로 바꾸는 것 Run - 클래스 확장자가 붙은 파일을 실행하는 것 Input - 우리가 실행한 파일에 입력값을 주는 것 API vs UI 📌API: Application Programming Interface, 자바가 기본적으로 제공하는 부품을 이용하는 것 📌UI: User Interface, 사용자가 우리가 만든 프로그램을 조작하기 위해 사용하는 조작장치 👉🏻우리가 만든 프로그램을부품으로 하는 또 다른 프로그램이 있다면 그 때는 API, 사람이 사용한다면 UI 패키지, 클래스, 변수, 메소드 📌패키지>클래스>메소드, 변수 👉🏻패키지: 여러 클래스를 그룹화해서..
[self-study/생활코딩] Ch11.입력과 출력 | ① 입력과 출력 ② arguments & parameter 참고자료: Youtube - 생활코딩 JAVA1 입력과 출력 import javax.swing.JOptionPane; import org.opentutorials.iot.DimmingLights; import org.opentutorials.iot.Elevator; import org.opentutorials.iot.Lighting; import org.opentutorials.iot.Security; public class OkJavaGoInHomeInput{ public static void main(String[] args) { //입력창을 열어준다. String id = JOptionPane.showInputDialog("Enter a ID"); String bright = JOptionPane...
[self-study/생활코딩] Ch10. 디버거 참고자료: Youtube - 생활코딩 JAVA1 디버거 📌debugging: 코드에서 예상치 못한 오류가 났을 때 해결하는 것. 👉🏻벌레 모양 버튼을 클릭하면 위와 같이 디버깅 화면으로 변한다. 👉🏻행 숫자를 더블클릭하면 break point가 걸린다.
[self-study/생활코딩] Ch9. | ① 프로그래밍이란 무엇인가? ② 프로그램 만들기 - IoT 라이브러리 설치하기 ③ 숫자와 연산 참고자료: Youtube - 생활코딩 JAVA1 프로그래밍이란 무엇인가 📌자동화: 시간의 순서대로 일어나는 일 📌프로그램: 자동화 처리를 하는 것 👉🏻복잡하고 많은 작업은 사람이 하는 것보다 컴퓨터에게 맡기는 것이 효율적이니 프로그래밍을 하는 것! 프로그램 만들기 - IoT 라이브러리 설치하기 👉🏻하나의 프로그램은 다른 사람들의 부품을 가져다 써서 나의 완제품을 만든다. → 라이브러리 사용 IOT 프로그램 import org.opentutorials.iot.Elevator; import org.opentutorials.iot.Lighting; import org.opentutorials.iot.Security; public class OkJavaGoInHome { public static void mai..

728x90