Skip to content

Instantly share code, notes, and snippets.

@ParkMinKyu
Last active August 29, 2015 14:26
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ParkMinKyu/71467683d6d09fe12257 to your computer and use it in GitHub Desktop.
Save ParkMinKyu/71467683d6d09fe12257 to your computer and use it in GitHub Desktop.
티스토리 자바 기초_3 기본 자료형을 이용한 사칙연산 샘플
class 계산기{
//값두개를 받는다.(int a, int b)
void 덧셈(int a, int b){
int c = a + b;
System.out.println("a+b=" + c);
}
void 빼기(){
//값을 두개 받는다.
//뺀다
//값을 출력한다.
}
void 곱하기(){
//값을 두개 받는다.
//곱한다.
//값을 출력한다.
}
void 나누기(){
//값을 두개 받는다.
//나눈다
//값을 출력한다.
}
public static void main(String args[]){
계산기 c = new 계산기();
System.out.println("하이");
c.덧셈(1,4);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment