- 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 and the next 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 Simple Program: Printing a Line of Text Compiling a program Open a command prompt window, go to directory where program is stored Type javac Welcome1.java If no errors, Welcome1.class created Has bytecodes that represent application Bytecodes passed to Java interpreter 2.2 A Simple Program: Printing a Line of Text Executing a program Type java Welcome1 Interpreter loads .class file for class Welcome1 .class extension omitted from command Interpreter calls method main 2.3 Modifying Our First Java Program Modify example in Fig. 2.1 to print same contents using different code Welcome2.java1. Comments2. Blank line3. Begin class Welcome23.1 Method main4. Method System.out.print4.1 Method System.out.println5. end main, Welcome2Program Output 1 // Fig. 2.3: Welcome2.java 2 // Printing a line of text with multiple statements. 3 4 public class Welcome2 { 5 6 // main method begins execution of Java application 7 public static void main( String args[] ) 8 { 9 System.out.print( Welcome to ); 10 System.out.println( Java Programming! ); 11 12 } // end method main 13 14 } // end class Welcome2 Welcome3.java1.
您可能关注的文档
- algorthm-homework.doc
- ACAA视编辑师模拟题第1套 2.doc
- Analying and Writing Articles for SSCI Publication.doc
- ansys一些常用命令:.doc
- ALLENHEATH_ZED14操作说明书.doc
- apach 配置 access_log 日志 格式 问题.doc
- APDL学笔记.doc
- API_5T石油套管.doc
- ansys磁场分析教程chapter-2-2.ppt
- Appelation in Chinese and English.ppt
- Chaptr 01 introduction.doc
- Chaptr 2 Distributive Bargaining.ppt
- Chaptr 11 语言学-Applied linguistics.ppt
- ch3-可程控制器基础.ppt
- CH9 Cannel Identification and Equalization.ppt
- Chaptr 4 Lexical analysis.ppt
- Chaptr 6 Acid and Bases, Electrophiles and Nucleophile.ppt
- chaptr 7 LG and standy LC.ppt
- chaptr 3 rotation of a rigid body.ppt
- Chaptr 2 GDP and standard of living.ppt
最近下载
- 2023版思想道德与法治全册课件.pptx
- 2021-2023年上海二模分类汇编:现代文二-上海市十六区近三年(2021-2023)高考语文一模、二模试题分类汇编(解析版).docx VIP
- DB41T2071连阴雨预警信号等级划分.pdf VIP
- 2025至2030中国存储卡行业市场深度分析及发展预测与投资策略报告.docx VIP
- 统编版八年级上册语文课内全部古诗词赏析(注音、注释、译文、赏析).pdf VIP
- 中西医结合加速康复外科共识.pptx VIP
- 特色中药材产业园项目可行性研究报告模板-立项备案.doc
- 基于PLC控制防盗门报警器设计.doc VIP
- 抗战胜利八十周年主题教育.pptx VIP
- 猪场拆除工程方案.pdf VIP
文档评论(0)