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

加入VIP,免费下载
 

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

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

下载须知

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

版权提示 | 免责声明

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

JAVA编程思想课后习题答案资料Word文档下载推荐.docx

1、 ATypeName a = new ATypeName(); a.i = 3; a.d = 2.71828; a.b = false; a.show();练习4:public class DataOnlyTest class DataOnly DataOnly data = new DataOnly(); data.i = 3; data.d = 2.71828; data.b = false; data.show();练习5:public class DOTest2 data.i = 234; data.d = 2.1234545; data.b = true;练习6:public cla

2、ss StorageTest class StoreStuff int storage(String s) return s.length() * 2; StoreStuff x = new StoreStuff(); System.out.println(x.storage(hi);练习7:class StaticTest static int i = 47;class Incrementable static void increment() StaticTest.i+;public class ITest System.out.println(StaticTest.i= + Static

3、Test.i); StaticTest st1 = new StaticTest(); StaticTest st2 = new StaticTest();st1.i= + st1.i);st2.i= + st2.i); Incrementable sf = new Incrementable(); sf.increment();After sf.increment() called: st1.i = st2.i = Incrementable.increment();After Incrementable.increment called:练习8:public class OneStatic

4、Test StaticTest st1 = new StaticTest(); StaticTest st2 = new StaticTest(); Incrementable.increment();After Incrementable.increment() called: st1.i = 3;After st1.i = 3, Create another StaticTest, st3. StaticTest st3 = new StaticTest();st3.i = + st3.i);练习9:public class AutoboxTest boolean b = false; c

5、har c = x; byte t = 8; short s = 16; int i = 32; long l = 64; float f = 0.32f; double d = 0.64; Boolean B = b;boolean b = + b); Boolean B = + B); Character C = c;char c = Character C = + C); Byte T = t;byte t = + t);Byte T = + T); Short S = s;short s = + s);Short S = + S); Integer I = i;int i = Inte

6、ger I = + I); Long L = l;long l = + l);Long L = + L); Float F = f;float f = + f);Float F = + F); Double D = d;double d = + d);Double D = + D);练习10:public class CommandArgTest args0 = + args0);args1 = + args1);args2 = + args2);练习11:public class Rainbow AllTheColorsOfTheRainbow atc = new AllTheColorsO

7、fTheRainbow();atc.anIntegerRepresentingColors = + atc.anIntegerRepresentingColors); atc.changeColor(7); atc.changeTheHueOfTheColor(77);After color change, atc.anIntegerRepresentingColors = atc.hue = + atc.hue);class AllTheColorsOfTheRainbow int anIntegerRepresentingColors = 0; int hue = 0; void chan

8、geTheHueOfTheColor(int newHue) hue = newHue; int changeColor(int newColor) return anIntegerRepresentingColors = newColor;练习12:public class DocTest /* Entry poing to class & application. * param args array of string arguments * throws exceptions No exceptions thrown */Hello, its: System.out.println(n

9、ew Date();练习13-1:public class Documentation1 /* A field comment */ public int i; /* A method comment */ public void f() 2:public class Documentation2 Date d = new Date(); void showDate() Date = 3:public class Documentation3 Date d = new Date();d = 练习14:public class Documentation4 public int i = 2;pr

10、ivate int j = 3;public static void main(String args) Date d = new Date();练习15:public class HelloDocTest 练习16:class Tree int height; Tree() Planting a seedling height = 0;Tree(int initialHeight) height = initialHeight;Creating new tree that is + height + feet tallvoid info() Tree is void info(String

11、s) System.out.println(s + : Tree is public class Overloading for(int i = 0; i 5; i+) Tree t = new Tree(i); t.info(); t.info(overloading method / Overloaded constructor: new Tree();第三章public class PrintTest print(Hello, from short form. P.rintln(Hello from greggordon form.Hello from long form.class T

12、ube float level;public class Assign Tube t1 = new Tube(); Tube t2 = new Tube(); t1.level = 0.9f; t2.level = 0.47f;1: t1.level: + t1.level + , t2.level: + t2.level); t1 = t2;2: t1.level = 0.27f;3:class Box float a;public class PassObject2 static void f(Box y) y.a = 2.71828f; Box x = new Box(); x.a =

13、3.1416f; x.a = + x.a); f(x);class VelocityCalculator static float velocity (float d, float t) if(t = 0) return 0f; else return d/t; public class VelocityTester float d = 565.3f; float t = 3.6f;Distance:Time: float v = VelocityCalculator.velocity(d, t);Velocity: + v);class Dog String name; String say

14、s; void setName(String n) name = n; void setSays(String s) says = s; void showName() P.rintln(name); void speak() P.rintln(says);public class DogTest Dog spot = new Dog(); spot.setName(Spot spot.setSays(Ruff! Dog scruffy = new Dog(); scruffy.setName(Scruffy scruffy.setSays(Wurf! spot.showName(); spo

15、t.speak(); scruffy.showName(); scruffy.speak();public class DogCompare Dog butch = new Dog(); butch.setName(Butch butch.setSays(Hello! butch.showName(); butch.speak();Comparison:spot = butch: + (spot = butch);spot.equals(butch): + spot.equals(butch);butch.equals(spot): + butch.equals(spot);Now assign: spot = butch spot = butch;Compare again: + (spot =

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

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