10월 5일 수요일
1. Git Remote Repository 만들기
2. IntelliJ로 Java Project 빌드
3. 빌드한 프로젝트 Push하기
UserDao
public class UserDao { //Data Access Object
public void plus(int first, int second) { //인스턴스 메서드
System.out.println(first + second);
}
public void minus(int first, int second) {
System.out.println(first - second);
}
public void multiple(int first, int second) {
System.out.println(first * second);
}
public void divide(int first, int second) {
System.out.println(first / second);
}
}
class UserDaoMain{
public static void main(String[] args) {
UserDao userDao = new UserDao(); //UserDao 객체 생성 or static 메서드로 변경
userDao.plus(1,2); //userDao객체가 없기 때문에 UserDao의 메서드를 사용할 수 없어서 에러가 생겼다.
}
}
SwapExcercise
public class SwapExcercise {
public static void main(String[] args) {
int a = 10;
int b = 20;
int temp = a;
a = b;
b = temp;
System.out.printf("a : %d b : %d");
System.out.println();
}
}
'멋쟁이 사자처럼 2기 150일간의 기록' 카테고리의 다른 글
RandomCalculator 클래스 - 인터페이스의 이해 (0) | 2022.10.05 |
---|---|
멋쟁이 사자처럼 백엔드스쿨 2기 16일차 D - 135 과제 (0) | 2022.10.04 |
CurrencyCnt 자바 화폐 계산 알고리즘 (0) | 2022.10.04 |
멋쟁이 사자처럼 백엔드스쿨 2기 16일차 D - 135 (Git, SourceTree 사용방법) (0) | 2022.10.04 |
단순 삽입정렬이란? InsertionSort (1) | 2022.09.29 |