2012-09-06 3 views
-1

나는이 용어가 무엇을 의미하는지 이해하는데 어려움을 겪고있다. 누군가가 나에게 설명해 준다면, 나는 그것을 고맙게 생각할 것이다.Java 클래스의 사양 및 구현?

이미 3 개 클래스를 호출 한 : 모양 사각형 원

다음 나는 삼각형

라는 클래스를 만들

A) 그들이 삼각형 ADT 유사한의 사양을 만들 말할 때 무엇을 의미 하는가 (나는 이미 클래스 위) 사각형 ADT에 사양

B)를 구현하는 클래스의 삼각

+0

당신이 무슨 뜻인지 "사양"과 "실행"묻는 : ADT는

Name: Description of the data structure: Operations: Construction operations: Initial values; Initialization processes; For each operation: Name of the operation; Input: External data that comes from the user of this data (client) Preconditions: Necesssary state of the system before executing this operation; Process: Actions performed by the data Output: Data that is output to the client Post Conditions: State of the system after executing this operation 

예를 가지고? 또는 ADT는 무엇입니까? (추상적 인 데이터 유형, 아마도). – Thilo

답변

0

"SP를 만들기 Triangle ADT "은 삼각형을 정의하는 데 필요한 데이터를 정의하는 것을 의미합니다 (3 개의 데카르트 좌표가 가장 직선이지만 단일 점, 3 개의 각 및 한 변 또는 다른 것일 수 있음). 내용 구조를 지정하는 실행 데이터를 개별적으로 설명 :

"클래스 삼각형을 구현은"내부 구현 implements Shape 그러나이 단계에서 정의 자바 표현 1.

0

ADT인지 자바 클래스를 작성하는 수단 및 데이터에 대한 법적 조작.

ADT circle 
Data: r³ 0 (radius); 
Operations 

    Costructor: 

     Initial values:radius of circle; 
     Process: Assign initial value of r; 

    Area: 

     Input: none; 
     Preconditions: none; 
     Process: A ¬ p *r*r Output: A 
     Postcondition: none 

    Circumference: 

     Input: None; 
     Preconditions: none; 
     Process: C ¬ 2*p *r 
     Output: C 
     Postconditions: none; 

End ADT circle;