1 / 18

Method & library

Method & library. INDEX. 1. 메소 드 정의 메소드 호출 Void 메소드 값 에 의한 매개 변수들의 전달 코 드 모듈화 메소 드 중복 정의 라이브러리. 메소드 정의. 메소드 정의. 메소드 헤더는 수정자 , 반환값 타입 , 메소드 이름 , 형식 매개 변수로 구성. 다른 언어들에서는 메소드들이 프로시저 와 함수로 언급되어지는데 값 - 반환 메소드는 함수로 , 보이드 메소드는 프로시저로 불린다 . – 참고 사항 -. 메소드 호출. 메소드 호출.

Download Presentation

Method & library

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Method & library

  2. INDEX 1. 메소드정의 • 메소드 호출 • Void 메소드 • 값에 의한 매개 변수들의 전달 • 코드 모듈화 • 메소드중복 정의 • 라이브러리

  3. 메소드 정의

  4. 메소드 정의 • 메소드 헤더는 수정자, 반환값 타입, 메소드 이름, 형식 매개 변수로 구성 • 다른 언어들에서는 메소드들이 프로시저와 함수로 언급되어지는데 값-반환 메소드는 함수로, • 보이드메소드는 프로시저로 불린다. –참고 사항-

  5. 메소드 호출

  6. 메소드 호출 예제 Source 실행결과

  7. Void 메소드

  8. Void 메소드 예제 Source 실행결과

  9. 값에 의한 매개 변수들의 전달

  10. 값에 의한 매개 변수들의 전달 예제 Source 실행결과

  11. 코드 모듈화

  12. 코드 모듈화 예제 Source 실행결과

  13. 코드 모듈화 • 코드를 모듈화하면 생기는 이점 • - main 메소드의 잔여 코드로부터 gcd를 계산하는 문제를 분리 • 시킬 수 있음 • - gcd를 계산하는 오류는 gcd메소드 내부로 제한하여 디버깅의 • 범위를 줄일 수 있음 • - gcd메소드는 다른 프로그램에서 재사용 가능

  14. 메소드 중복 정의

  15. 메소드 중복정의 예제 Source 실행결과

  16. 라이브러리(Library)

  17. String 클래스와 System 클래스의 클래스 파일 라이브러리 • 라이브러리란? • - JDK에 포함된 미리 만들어진 • 소프트웨어(클래스 & 인터페이스)들의 모임 이런 파일들 안에 JDK 라이브러리의 클래스와 인터페이스들이 들어있습니다.

More Related