- 1、本文档共61页,可阅读全部内容。
- 2、有哪些信誉好的足球投注网站(book118)网站文档一经付费(服务费),不意味着购买了该文档的版权,仅供个人/单位学习、研究之用,不得用于商业用途,未经授权,严禁复制、发行、汇编、翻译或者网络传播等,侵权必究。
- 3、本站所有内容均由合作方或网友上传,本站不对文档的完整性、权威性及其观点立场正确性做任何保证或承诺!文档内容仅供研究参考,付费前请自行鉴别。如您付费,意味着您自己接受本站规则且自行承担风险,本站不退款、不进行额外附加服务;查看《如何避免下载的几个坑》。如果您已付费下载过本站文档,您可以点击 这里二次下载。
- 4、如文档侵犯商业秘密、侵犯著作权、侵犯人身权等,请点击“版权申诉”(推荐),也可以打举报电话:400-050-0827(电话支持时间:9:00-18:30)。
查看更多
Java语言程序设计 参考资料2
Chapter 2 - Introduction to Java Applications 2.1 Introduction In this chapter Introduce examples to illustrate features of Java Two program styles - applications and applets 2.2 A Simple Program: Printing a Line of Text Application Program that executes using the java interpreter Sample program Show program, then analyze each line Welcome1.javaProgram Output 1 // Fig. 2.1: Welcome1.java 2 // A first program in Java. 3 4 public class Welcome1 { 5 6 // main method begins execution of Java application 7 public static void main( String args[] ) 8 { 9 System.out.println( Welcome to Java Programming! ); 10 11 } // end method main 12 13 } // end class Welcome1 2.2 A Simple Program: Printing a Line of Text Comments start with: // Comments ignored during program execution Document and describe code Provides code readability Multiple line comments: /* ... */ /* This is a multiple line comment. It can be split over many lines */ Another line of comments Note: line numbers not part of program, added for reference 2.2 A Simple Program: Printing a Line of Text Blank line Makes program more readable Blank lines, spaces, and tabs are white-space characters Ignored by compiler Begins class definition for class Welcome1 Every Java program has at least one user-defined class Keyword: words reserved for use by Java class keyword followed by class name Naming classes: capitalize every word SampleClassName 2.2 A Simple Program: Printing a Line of Text Name of class called identifier Series of characters consisting of letters, digits, underscores ( _ ) and dollar signs ( $ ) Does not begin with a digit, has no spaces Examples: Welcome1, $value, _value, button7 7button is invalid Java is case sensitive (capitalization matters) a1 and A1 are different For chapters 2 to 7, use public keyword Certain details not important now Mimic certain features, discussions later 2.2 A Simple Program: Printing a L
您可能关注的文档
- Introduction of TESCO Own-label Vegetable--TESCO自有品牌蔬菜简介.ppt
- Introduction to Computing 计算概论.ppt
- Introduction to College English主讲教师_张家瑞.ppt
- introduction to six sigma 課件.ppt
- investment_-1课堂.ppt
- In_The_Earthquakes_的证.pptx
- IP001项目管理与软件项目管理.pptx
- IP102-07软件项目进度计划.ppt
- IP104-13软件项目集成计划.pptx
- iPhone+平台游戏中国市场研究+v01.pptx
- 2024年全球及中国吹灌封服务行业头部企业市场占有率及排名调研报告.docx
- 2024-2030全球药用尿素行业调研及趋势分析报告.docx
- 2024年全球及中国人工智能诊断工具行业头部企业市场占有率及排名调研报告.docx
- 2025年湖南体育职业学院高职单招综合素质考试参考题库及答案解析.docx
- 2024-2030全球手术豆袋定位器行业调研及趋势分析报告.docx
- 2024-2030全球即插即用水疗浴缸行业调研及趋势分析报告.docx
- 2024年全球及中国OEM控制器行业头部企业市场占有率及排名调研报告.docx
- 2025年闽西职业技术学院高职单招综合素质考试参考题库及答案解析.docx
- 2024年全球及中国250cc及以上休娱摩托车行业头部企业市场占有率及排名调研报告.docx
- 2025年共青科技职业学院高职单招职业技能考试参考题库及答案解析.docx
最近下载
- 中医养生预防脑血管疾病的措施(3).pptx
- 教育部2024年专项任务项目(高校辅导员研究)申请评审书《增强高校辅导员与学生谈心谈话的针对性和实效性研究》.docx VIP
- YBJ-PS03-2004埋地无压预制混凝土排水圆形管管基及接口.pdf
- 家校社协同育人教联体典型案例(幼小中).doc
- 智慧教育双师课堂解决方案.pdf
- DL∕T 1949-2018 -火力发电厂热工自动化系统电磁干扰防护技术导则.pdf
- 2023云南昆明空港投资开发集团招聘7人考前自测高频考点模拟试题(共500题)含答案详解.docx
- 营销三大法宝-销售带动配合-PPT课件.ppt
- 人教版本历史七下第3课(开元盛世)课件3.ppt
- 2025考研英语一真题及答案.pdf
文档评论(0)