본문 바로가기

자바과정/스터디6

파이썬 기초 다지기 파이썬에 대한 기초 익히기 // 기본 정리 출처 : includestdio.tistory.com/16 [Python] 사칙연산을 위한 7가지 연산자 1. 파이썬(Python) 사칙연산을 위한 7가지 연산자 + 덧셈 - 뺄셈 * 곱하기 ** 거듭 제곱 / 나누기 // 나누기 연산 후 소수점 이하의 수를 버리고, 정수 부분의 수만 구함 % 나누기 연산 후 몫이 아닌 나 includestdio.tistory.com # +, -, *, **, /, //, % # ** 거듭제곱, // 나누기 연산 후 소수점 이하의 수를 버리고 정수 부분의 수만 구함 # % 나머지만 구함 # 파이썬 출력문 print # 파이썬 끝 구분자가 없음 ; print(2 ** 4) print(4 / 6) print(4 // 6) print.. 2021. 2. 27.
Java 기초 - 6일차 - 구조 이해 - 호출 순서 참고 사이트 burucodegallery.blogspot.com/2013/08/2-5-inheritance2-specialization.html - 기본 코드 package Test; // 함수는 끝나면 자신을 호출한 곳으로 돌아감. class A{ public A() { // super(); 부모 생성자 호출 // 오브젝트의 생성자로 감. System.out.println("super class"); } public A(int a) { System.out.println(a + "2번째 생성자."); } } public class IsAExam6 extends A { // extends(상속) Object를 상속받고 있음 // 디폴트 생성자 // this() 호출은 또 다른 .. 2021. 2. 4.
스터디 3일차(this, 클래스, 실습추가) --------------------------this 보완 -- 내 코드 ------ this에 대한 실습코드 public class ThisCall { //field private int i,j; //constructor //오버로딩 public ThisCall() { } public ThisCall(int i) { this.i = i; } public ThisCall(int i, int j) { this.i = i; this.j = j; } //method public int getA() { return i; } public int getB() { return j; } public static void main(String[] args) { ThisCall tc1 = new ThisCall(); T.. 2021. 2. 3.
스터디 2일차(실습 코드 보완) - 기존 코드는 필드와 메소드(setter/getter)로만 사용한 반면 복습을 통해 생성자로 코드를 재작성 해봄. (getter도 같이 이용) 사칙연산계산기 import java.util.Scanner; //클래스 필드 생성자 메소드 오버로딩 //계싼기 객체 계산기 쓸 수 있는 환경 //생성자를 이용한 사칙연산계산기 public class OperNew { // 필드 초기화 : 사용할 변수들 private int num1, num2; private char op; public OperNew() {} // 디폴트 생성자 public OperNew(int a, char b, int c) { this.num1 = a; this.op = b; this.num2 = c; } public int getA() { .. 2021. 2. 2.