public class Main
{
public static void main(String args[])
{
Result result = new Result();
result.Resulting();
}
}
class Rectangle
{
int width;
int height;
void getArea()
{
int area;
area = width*height;
System.out.println(area);
}
void getPerimeter()
{
int peri;
peri = (width+width)*2;
System.out.println(peri);
}
} import java.util.Scanner;
class Result
{
void Resulting()
{
Scanner input = new Scanner(System.in);
Rectangle rect = new Rectangle();
rect.width = input.nextInt();
rect.height = input.nextInt();
rect.getArea();
rect.getPerimeter();
}
}
{
public static void main(String args[])
{
Result result = new Result();
result.Resulting();
}
}
class Rectangle
{
int width;
int height;
void getArea()
{
int area;
area = width*height;
System.out.println(area);
}
void getPerimeter()
{
int peri;
peri = (width+width)*2;
System.out.println(peri);
}
} import java.util.Scanner;
class Result
{
void Resulting()
{
Scanner input = new Scanner(System.in);
Rectangle rect = new Rectangle();
rect.width = input.nextInt();
rect.height = input.nextInt();
rect.getArea();
rect.getPerimeter();
}
}
Resulting이라는 메서드는 오로지 rect에 관한건데 왜 다른 객체에서 또 메서드로 선언을 했을까...?
메인에서 말씀하시는건가욥??
연산 - 입력 - 메인 으로나눠봤어요..
아니 연산 - 입력,출력 - 메이
클래스 기반으로 코딩하지말고 인터페이스 기반으로 코딩하세요.
아직거기까지못갔 ㅠ 감사합니다
188 ㅂㅋㄹ 오토 6방 한꺼번에 돌아간다 로직 200개넘는다 무조건딴다 nete77