- 1、原创力文档(book118)网站文档一经付费(服务费),不意味着购买了该文档的版权,仅供个人/单位学习、研究之用,不得用于商业用途,未经授权,严禁复制、发行、汇编、翻译或者网络传播等,侵权必究。。
- 2、本站所有内容均由合作方或网友上传,本站不对文档的完整性、权威性及其观点立场正确性做任何保证或承诺!文档内容仅供研究参考,付费前请自行鉴别。如您付费,意味着您自己接受本站规则且自行承担风险,本站不退款、不进行额外附加服务;查看《如何避免下载的几个坑》。如果您已付费下载过本站文档,您可以点击 这里二次下载。
- 3、如文档侵犯商业秘密、侵犯著作权、侵犯人身权等,请点击“版权申诉”(推荐),也可以打举报电话:400-050-0827(电话支持时间:9:00-18:30)。
- 4、该文档为VIP文档,如果想要下载,成为VIP会员后,下载免费。
- 5、成为VIP后,下载本文档将扣除1次下载权益。下载后,不支持退款、换文档。如有疑问请联系我们。
- 6、成为VIP后,您将拥有八大权益,权益包括:VIP文档下载权益、阅读免打扰、文档格式转换、高级专利检索、专属身份标志、高级客服、多端互通、版权登记。
- 7、VIP文档为合作方或网友上传,每下载1次, 网站将根据用户上传文档的质量评分、类型等,对文档贡献者给予高额补贴、流量扶持。如果你也想贡献VIP文档。上传文档
查看更多
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 First Program in Java: 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 // Text-printing program. 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 First Program in Java: Printing a Line of Text Comments start with: // Comments ignored during program execution Document and describe code Provides code readability Traditional comments: /* ... */ /* This is a traditional 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 declaration 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
您可能关注的文档
- Compan的y research data.doc
- cost_c的orrosion.ppt
- Cyber-的Physical Systems Issues and Challenges_2011.ppt
- Data I的ntegration in Excel.ppt
- DC-1 5的2 multidisciplinary practitioners.ppt
- Design的_of_the_Closed_Loop_Speed_Control_System_for_DC_Motor.doc
- DMSO的性的质.doc
- DSP 2的8335 教程 8.ppt
- easyui的-属性.doc
- Emeral的d全文期刊数据库.ppt
- Journa的l of Systems Architecture Aerospace Science and Technology.doc
- KGP011的SM-07 锅炉运行说明书.doc
- Landsa的t 7 校正.doc
- layout的_introduction.ppt
- Learni的ng Objectives Chapter 6 Marketing Research.ppt
- Learni的ng to Speak English Is an Art.doc
- Lesson的 11 HighwayEngineering.ppt
- linux添的加并挂载新磁盘或优盘的方法.doc
- Loan-i的nfo-schema.ppt
- M4P1 I的ntroduction and Reading.ppt
最近下载
- 广东长大美国科来福道路预防性养护和桥梁无缝伸缩缝系统工艺.pptx VIP
- 九年一贯制学校管理.pptx VIP
- 人力资源服务公司章程(申请人力资源许可证参考用).pdf VIP
- 四川大学生物医学工程基础课件.ppt
- 马克思的剩余价值理论课件(PPT 33页).ppt VIP
- SOC-OCV电池测试报告.docx VIP
- 纯化过滤专题报告之一:离子交换与吸附树脂行业报告,纯,现代工业生产中极致的魅力.pdf VIP
- 人类辅助生殖技术和人类精子库伦理原则.doc VIP
- 投标项目总体架构及技术解决方案.docx VIP
- 高二奋发+勇攀高峰+课件--2025-2026学年高二上学期开学第一课主题班会.pptx VIP
文档评论(0)