ImageVerifierCode 换一换
格式:DOCX , 页数:54 ,大小:55.31KB ,
资源ID:14384687      下载积分:3 金币
快捷下载
登录下载
邮箱/手机:
温馨提示:
快捷下载时,用户名和密码都是您填写的邮箱或者手机号,方便查询和重复下载(系统自动生成)。 如填写123,账号就是123,密码也是123。
特别说明:
请自助下载,系统不会自动发送文件的哦; 如果您已付费,想二次下载,请登录后访问:我的下载记录
支付方式: 支付宝    微信支付   
验证码:   换一换

加入VIP,免费下载
 

温馨提示:由于个人手机设置不同,如果发现不能下载,请复制以下地址【https://www.bdocx.com/down/14384687.html】到电脑端继续下载(重复下载不扣费)。

已注册用户请登录:
账号:
密码:
验证码:   换一换
  忘记密码?
三方登录: 微信登录   QQ登录  

下载须知

1: 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。
2: 试题试卷类文档,如果标题没有明确说明有答案则都视为没有答案,请知晓。
3: 文件的所有权益归上传用户所有。
4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
5. 本站仅提供交流平台,并不能对任何下载内容负责。
6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。

版权提示 | 免责声明

本文(网络编程实验报告docWord文档下载推荐.docx)为本站会员(b****3)主动上传,冰豆网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对上载内容本身不做任何修改或编辑。 若此文所含内容侵犯了您的版权或隐私,请立即通知冰豆网(发送邮件至service@bdocx.com或直接QQ联系客服),我们立即给予删除!

网络编程实验报告docWord文档下载推荐.docx

1、3、编写使用不同循环结构结构的程序。实验内容:public class DataTypes public static void main(String args) byte b=127; short s=32767; int i=2147483647; long l=9223372036l;/为什么long表示的数比Int还小? char c=c; float f=1.23F; double d=0.9E-3; boolean bool=true; System.out.println( b=+b); s=+s); i=+i); l=+l); c=+c); f=+f); d=+d); boo

2、l=+bool); /public class Testif boolean leap; int year=2014; if(year%4=0&year%100!=0)|(year%400=0)/ System.out.println(year+年是闰年); else年不是闰年 /方法二/ year=2008; if(year%4!=0) leap=false; else if(year%100! leap=true; else if(year%400! else if(leap=true) System.out.println(year+ /方法三/ year=2050; if(year%4

3、=0) if(year%100=0) if(year%400=0) leap=true; else leap=false; else leap=false; /使用switch语句/1.编写程序用Switch语句实现从键盘上都1,2,3时,屏幕提示不同的信息import java.io.*;class SwitchTest public static void main(String args) throw IOException char a;Enter a number from 1-3: a=(char)System.in.read(); switch(a) case 1: System

4、.out.println(win a Car!break; case 2picked the goat3get to keep your100! default:System.out.println(entry/for循环语句class ForTest public static void main(String args)throws IOException int fahr,cels; System.out.println(Celsius Fahrenheit for(cels=0;cels=100;cels+=5) fahr=cels*9/5+32; System.out.println

5、(cels+ +fahr); char a; outer:/this is the lable for the outer loop for(int i=0;i10;i+) for(int j=0;jj+) a=(char)System.in.read(); if(a=b) break outer; continue outer;/while循环语句/class WhileTest public static void main(String args)throws IOException char ch;按1/2/3数字可获大奖!按空格键后回车可退出循环操作 while(ch=(char)S

6、ystem.in.read()!= System.in.skip(2);/跳过回车键 switch(ch) case恭喜你获得大奖,一辆汽车不错呀,你得到一台笔记本电脑 case 没白来,你得到一台冰箱 default: System.out.println(真不兴,你没有奖品!下次再来 /多重循环public class Mul99 public static void main(String args) int i,j, n=9; System.out.print( * | for(i=1;n-| for(i=1;- System.out.println();=n;i+) System.o

7、ut.print(+i+ | for(j=1;=i;j+)+i*j);实验感想: 实验二 面向对象编程试验通过编程和上机实验理解Java语言是如何体现面向对象编程基 本思想,熟悉类的封装方法以及如何创建类和对象,熟悉成员变量和成员方法的 特性,熟悉类的继承性和多态性的作用,熟悉包、接口的使用方法,掌握OOP 方式进行程序设计的方法。1、编写程序实现类的定义和使用。2、编写不同成员和不同成员方法修饰方法的程序。3、编写体现类的继承性(成员变量、成员方法、成员变量隐藏)的程序 和多态性(成员方法重载、构造方法重载)的程序。4、编写接口的定义和使用的程序。5、编写包的定义和使用的程序。实验内容-1. 日期类输出当前日期public class Dateprivate int year,month,day;/private static thisYear; public Date(int y,int m,int d) this.year=y; this.month=m; this.day=d; public void read(int y,int

copyright@ 2008-2022 冰豆网网站版权所有

经营许可证编号:鄂ICP备2022015515号-1