Topic: 请教(关于Thinking in Java)

  Print this page

1.请教(关于Thinking in Java) Copy to clipboard
Posted by: skymysky777
Posted on: 2005-06-22 15:25

我现在看thinking in java
其中。。。最开始中经常会提到。。。。什么对reference赋值。。。什么。。。都是reference。。。。什么什么。。这个reference被怎么怎么地了。。。等等这类的话句。。~
请我问不知道应该怎么样去理解reference这个词~!
是不是我太笨了???
请教请教~!~!~!

2.Re:请教高手~(最好是WHY进来) [Re: skymysky777] Copy to clipboard
Posted by: skymysky777
Posted on: 2005-06-22 15:35

还有一个问题:在程序中有void 名 (int a,int b){ .......}
这个VOID是什么意思呢?

3.Re:请教關于thinking in java [Re: skymysky777] Copy to clipboard
Posted by: why
Posted on: 2005-06-22 20:46

请使用准确的文字描述作为标题
It will be removed if you don't correct it (by editing the first post).


reference -- frankly I don't know what/where you're referring to.
Ch3 / Assignment -- reference vs value, I don't know anyone would not understand this.
Since the primitive holds the actual value and not a reference to an object, when you assign primitives, you copy the contents from one place to another. ...

Ch6 / Composition syntax -- object reference vs primitive value
Until now, composition has been used quite frequently. You simply place object references inside new classes. For example, suppose you’d like an object that holds several String objects, a couple of primitives, and an object of another class. For the nonprimitive objects, you put references inside your new class, but you define the primitives directly: ...
...
Primitives that are fields in a class are automatically initialized to zero, as noted in Chapter 2. But the object references are initialized to null


void -- this method has no return value

4.Re:请教關于thinking in java [Re: why] Copy to clipboard
Posted by: skymysky777
Posted on: 2005-06-23 12:14

why wrote:
请使用准确的文字描述作为标题
It will be removed if you don't correct it (by editing the first post).


reference -- frankly I don't know what/where you're referring to.
Ch3 / Assignment -- reference vs value, I don't know anyone would not understand this.
Since the primitive holds the actual value and not a reference to an object, when you assign primitives, you copy the contents from one place to another. ...

Ch6 / Composition syntax -- object reference vs primitive value
Until now, composition has been used quite frequently. You simply place object references inside new classes. For example, suppose you’d like an object that holds several String objects, a couple of primitives, and an object of another class. For the nonprimitive objects, you put references inside your new class, but you define the primitives directly: ...
...
Primitives that are fields in a class are automatically initialized to zero, as noted in Chapter 2. But the object references are initialized to null


void -- this method has no return value


有点晕~~!~
VOID明白是什么意思!~~、
关于reference..。。。。有点晕~~!(原因本人的英语不太好~!)请用中文~谢谢~

5.Re:请教關于thinking in java [Re: skymysky777] Copy to clipboard
Posted by: why
Posted on: 2005-06-23 18:18

skymysky777 wrote:
有点晕~~!~
VOID明白是什么意思!~~、
关于reference..。。。。有点晕~~!(原因本人的英语不太好~!)请用中文~谢谢~

Sorry, 敝人不太清楚 reference 的標準中譯是甚麼,有点晕~~Embaressed
請閣下下載有關章節的中譯研習

6.Re:请教關于thinking in java [Re: why] Copy to clipboard
Posted by: skymysky777
Posted on: 2005-06-24 12:27

why wrote:
Sorry, 敝人不太清楚 reference 的標準中譯是甚麼,有点晕~~Embaressed
請閣下下載有關章節的中譯研習


谢谢~WHY帮我把标题改正了~~

不过还是请有关人士回答帮助我~~~再下先谢谢了~~!、

也请WHY继续关注这里~我以后还会有问题的~需要您的帮助~~~

7.Re:请教(关于Thinking in Java) [Re: skymysky777] Copy to clipboard
Posted by: why
Posted on: 2005-06-25 09:27

不过还是请有关人士回答帮助我~~~再下先谢谢了~~!

If you really expect someone to help you, please be specific and quote from the book.
Tell us what you think and what you don't understand.

Have you read the Chinese version of Thinking in Java? There are some free chapters on the web -- do your homework first.

Also, spell-check (well, manually with Chinese)
再下 --> 在下

有关人士? Who are 有关人士 you expect?
有关什麼?

8.Re:请教(关于Thinking in Java) [Re: why] Copy to clipboard
Posted by: snowbird2005
Posted on: 2005-06-25 15:24

我觉得why真是一个严谨、耐心又不乏幽默的很有个性的人。
比较喜欢看why的帖子

9.Re:请教(关于Thinking in Java) [Re: skymysky777] Copy to clipboard
Posted by: leiofll
Posted on: 2005-06-25 19:38

void 就是返回值无类型的意思
那个reference不太清楚了

10.Re:请教(关于Thinking in Java) [Re: leiofll] Copy to clipboard
Posted by: skymysky777
Posted on: 2005-06-27 13:15

leiofll wrote:
void 就是返回值无类型的意思
那个reference不太清楚了

问的就是reference的意思~~~~
有人知道吗?

有关人士就是指知道这个词的意思的人~~

11.Re:请教(关于Thinking in Java) [Re: skymysky777] Copy to clipboard
Posted by: ljy0000
Posted on: 2005-06-27 14:55

可以借用C++中的一个名词“引用”,但是与C++中的“引用”具有很大区别,你看看第2章的注解10,作者自己也拿不准。

12.Re:请教(关于Thinking in Java) [Re: skymysky777] Copy to clipboard
Posted by: ww1ww1
Posted on: 2005-06-27 22:19

我的理解
reference 有点像“别名、代号”的意思。

例如:


public class Reference {
int i;
Reference(int i){
this.i = i;
}
public static void main(String[] args){
Reference r1 = new Reference(1);
Reference r2 = new Reference(2);
Reference r3 = r1;
System.out.println("r1 = " + r1.i);
System.out.println("r2 = " + r2.i);
System.out.println("r3 = " + r3.i);
r3 = r2;
System.out.println("r3 changed");
System.out.println("r3 = " + r3.i);
}
}


开始 r3与 r1同样是new Reference(1)所生成的Object实例的别名(代号)
而后 r3成了 r2的 new Reference(2)所生成的Object实例的别名(代号)了。

不知道这样理解是否正确?

13.Re:请教(关于Thinking in Java) [Re: ljy0000] Copy to clipboard
Posted by: skymysky777
Posted on: 2005-07-05 16:11

ljy0000 wrote:
可以借用C++中的一个名词“引用”,但是与C++中的“引用”具有很大区别,你看看第2章的注解10,作者自己也拿不准。

谢谢这位人兄的提醒~~~~~

有关于THINKING IN JAVA的一些问题大家都可以在这里提出啊~
供大家一起学习交流~~~


   Powered by Jute Powerful Forum® Version Jute 1.5.6 Ent
Copyright © 2002-2021 Cjsdn Team. All Righits Reserved. 闽ICP备05005120号-1
客服电话 18559299278    客服信箱 714923@qq.com    客服QQ 714923