Introduction to Computers and ProgrammingIntroduction to .ppt
《Introduction to Computers and ProgrammingIntroduction to .ppt》由会员分享,可在线阅读,更多相关《Introduction to Computers and ProgrammingIntroduction to .ppt(16页珍藏版)》请在麦多课文档分享上搜索。
1、Introduction to Computers and Programming Introduction to Methods in Java,Introduction to Computers and Programming in JAVA: V22.0002,Road Map,Introduction to Methods Divide and Conquer Abstraction Using Pre-Packaged Modules Understanding Method signatures Understanding java.lang.math methods Creati
2、ng your own methods,Introduction to Methods,4,6.1 Introduction,Modules Small pieces of a problem e.g., divide and conquer Facilitate design, implementation, operation and maintenance of large programs,5,6.2 Program Modules in Java,Modules in Java Methods (based on functions in procedural programming
3、) Classes (object oriented programming) Java API provides several modules that are already defined in java “system defined” Math.random() Programmers can also create their own modules e.g., programmer-defined methods Methods Invoked by a method call Returns a result to calling method (caller) Simila
4、r to a boss (caller) asking a worker (called method) to complete a task. The boss method delegates certain jobs to specific methods.,6,Fig. 6.1 Hierarchical boss-method/worker-method relationship.,Examples of methods,A method that determines the maximum of two numbers. A method that sorts a list of
5、names A method that opens a file from the file system. A method that reads from the open file. A method that opens a new socket to the internet. A method that reads from that socket.,Important concept #1,Divide and Conquer: Break large programs into a series of smaller modulesHelps manage complexity
6、 Makes it easier to build large programs Makes it easier to debug programs,Important concept #2,Methods provide: Abstraction (information hiding): Most of the time, you need to know what a function does, but not how it actually does it. Also helps manage complexity You use other peoples code without
- 1.请仔细阅读文档,确保文档完整性,对于不预览、不比对内容而直接下载带来的问题本站不予受理。
- 2.下载的文档,不会出现我们的网址水印。
- 3、该文档所得收入(下载+内容+预览)归上传者、原创作者;如果您是本文档原作者,请点此认领!既往收益都归您。
下载文档到电脑,查找使用更方便
2000 积分 0人已下载
下载 | 加入VIP,交流精品资源 |
- 配套讲稿:
如PPT文件的首页显示word图标,表示该PPT已包含配套word讲稿。双击word图标可打开word文档。
- 特殊限制:
部分文档作品中含有的国旗、国徽等图片,仅作为作品整体效果示例展示,禁止商用。设计者仅对作品中独创性部分享有著作权。
- 关 键 词:
- INTRODUCTIONTOCOMPUTERSANDPROGRAMMINGINTRODUCTIONTOPPT

链接地址:http://www.mydoc123.com/p-376643.html