实验一Java语言概述_第1页
实验一Java语言概述_第2页
实验一Java语言概述_第3页
免费预览已结束,剩余1页可下载查看

下载本文档

版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领

文档简介

1、实验一 Java语言概述1实验目的(1)掌握Java语言的基本原理。2)掌握JDK开发工具的安装和配置。(3)通过简单的程序设计,掌握Java程序的运行原理4)理解JVM虚拟机原理。(5) 了解常用的可执行程序的命令行参数。2实验内容2.1 JDK的安装和配置【基本要求】(1) JDK安装设置成功,并能设置PATH和CLASSPAT环境变量。2)熟悉目录结构,熟悉目录的不同的文件格式。(3) 用 help 来查看 javac.exe、java.exe、javadoc.exe 等可执行文 件的命令行参数,理解各个参数的含义。2.2 编写 HelloWorld 程序【问题描述】编写一个简单的Jav

2、a程序,该程序运行之后在命令行中能够产生“ HelloWorld ”字符串的输出。【基本要求】(1)编辑该程序,并保存为HelloWorld.java 文件。ftorkspace 'Default'' : 0 Projects I二 ExteriLal FilesKellcWftrd. j ava(2)编译运行HelloWorld程序1734:作区默认:0项目 外部文件Jj avaI类JMBYeL是公共的,旺S为的交悴中更明H411oVaTLd.BA1T public class HelloVorldpublic static void nain (String arg

3、s)System . out . printlnf''HelloVorld! pub 1 ic static void main ('String args ) SysteiiL. out . print In ( 11 HelloUorld ! 11 );5:- LeA C: Progra> FilesXJCreat or ProGE2001. ese lelloUorld!Press anj/ key to continu© (3) 如果所保存的文件名跟类名HelloWorld 不同,如文件名叫做Helloworld.java,编译运行该程序会出现什

4、么情况?(4) 将该程序中的 main()方法改为其他方法,如 Show(),编译运行该 程序,看看会出现什么情况?2345ow |(String args) elloWorldlH);El public class HelloWorld public static void tSystem. out . pm uQ C:Progra* FilesJCreator ProGE2D0l.exeException in thre ad ' pna in' El public 匚:丄自启:壬厂 匕丄丄口W口匸 jaua. Ian or HoEuchHetliodEi'i

5、9;or1 : main Press anv key to continut2.3 变量的输出编写一个Java程序,用来在控制台上显示变量的输出1234563 public class changenuniberpublic static void main (String args) int x;x = 2;System. out . print丄 11(耳):曲 C:PrograK FilesJCreator ProGE2001.exe2Ppess an/ kev to continue,3 实验总结public class HelloWorld public static void ma

6、in (String args)System.out.pri ntln ("HelloWorld!"); When you are old and grey and full of sleep,And no ddi ng by the fire, take dow n this book,And slowly read, and dream of the soft lookYour eyes had on ce, and of their shadows deep;How many loved your mome nts of glad grace,And loved yo

7、ur beauty with love false or true,But one man loved the pilgrim soul in you,And loved the sorrows of your cha nging face;And bending down beside the glowing bars,Murmur, a little sadly, how love fledAnd paced upon the mountains overheadAnd hid his face amid a crowd of stars.The furthest distance in

8、the worldIs not between life and deathBut when I stand in front of youYet you don't know thatI love you.The furthest distance in the worldIs not when I stand in front of youYet you can't see my loveBut when undoubtedly knowing the love from bothYet cannot be together.The furthest distance in the worldIs not being apart while being in loveBut when I plainly cannot resist the yearningYet prete nding you have n ever bee n in my heart.The furthest dista nee in the w

温馨提示

  • 1. 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。图纸软件为CAD,CAXA,PROE,UG,SolidWorks等.压缩文件请下载最新的WinRAR软件解压。
  • 2. 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
  • 3. 本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
  • 4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
  • 5. 人人文库网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
  • 6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
  • 7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。

评论

0/150

提交评论