java 板


LINE

※ 引述《sbrhsieh (十年一梦)》之铭言: : : -- : : ◆ From: 118.168.127.139 : : 推 PsMonkey:其实... 用中文感觉很怪...... 10/14 21:16 : : → adrianshum:我个人是宁愿用 pointer 一词。reference 常有不清混淆 10/14 22:33 : : → adrianshum:还有其实 Java 的 ref 根本就是概念上的 pointer,只是 10/14 22:34 : : → adrianshum:没有像C/C++那种 pointer arithematics 而己 10/14 22:34 : : → Chikei:ptr +1,用ref常会有人问call by ??跟参照到哪个实体的问题 10/14 22:59 : 主要是看个人对 pointer 的定义。 : 我个人认为能作 pointer arithmetic 的才叫 pointer。 呃,我想Java对pointer的定义正好是不能做poitner arithemetic的pointer JLS7: 4.1 The Kinds of Types and Values There are two kinds of types in the Java programming language: primitive types (§4.2) and reference types (§4.3). There are, correspondingly, two kinds of data values that can be stored in variables, passed as arguments, returned by methods, and operated on: primitive values (§4.2) and reference values (§4.3). 4.3 Reference Types and Values 4.3.1 Objects An object is a class instance or an array. The reference values (often just references) are ***pointers*** to these objects, and a special null reference, which refers to no object. --



※ 发信站: 批踢踢实业坊(ptt.cc)
◆ From: 1.34.138.208
1F:→ swpoker:java就是没有C/C++的指标阿~虽然原PO应该如何隐藏实作吧 10/15 09:23
2F:→ sbrhsieh:如果设计者这样想,为什麽不在 spec. 里直接用 pointer v 10/15 15:46
3F:→ sbrhsieh:而是用 ref value, 整个 spec. 只昙花一现提到 pointers? 10/15 15:48
4F:→ adrianshum:没有人知道为什麽会叫ref, 尤其从NullPointerException 10/15 22:06
5F:→ adrianshum:的名字可见其实原本好像真的是用 Pointer 一词。有人猜 10/15 22:06
6F:→ adrianshum:想是当初推出前为了和C/C++的"万恶" pointer 有所分野 10/15 22:07
7F:→ adrianshum:所以改用 reference 一词。是真是假就不得而知了 10/15 22:07
8F:→ sbrhsieh:换个名称很合理啊,不然我会笑称它三脚猫pointer XD 10/15 22:24
9F:→ adrianshum:问题是叫ref太容易混淆了。我宁愿叫Handle或Opeque Ptr 10/16 06:27
10F:→ adrianshum:况且pointer 的重点是indirection, ptr arithemaic本来 10/16 06:29
11F:→ adrianshum:就不是必要... 10/16 06:29
12F:推 aiti80630:版标是在讲这篇吗? 10/16 13:01
13F:→ Schelfaniel:C# 就是用 NullReferenceException 的样子 10/16 13:02
14F:推 PsMonkey:干麽那麽注意版标 XDDD 10/16 13:25
15F:→ Killercat:C#....这状况又复杂点 尤其混杂unsafe的时候 +_+ 10/16 13:28
16F:→ Killercat:不过在正常没有unsafe下 大致上跟java应该是一样的 10/16 13:30
17F:推 aiti80630:因为版标变更的频率也太高了 10/16 17:24







like.gif 您可能会有兴趣的文章
icon.png[问题/行为] 猫晚上进房间会不会有憋尿问题
icon.pngRe: [闲聊] 选了错误的女孩成为魔法少女 XDDDDDDDDDD
icon.png[正妹] 瑞典 一张
icon.png[心得] EMS高领长版毛衣.墨小楼MC1002
icon.png[分享] 丹龙隔热纸GE55+33+22
icon.png[问题] 清洗洗衣机
icon.png[寻物] 窗台下的空间
icon.png[闲聊] 双极の女神1 木魔爵
icon.png[售车] 新竹 1997 march 1297cc 白色 四门
icon.png[讨论] 能从照片感受到摄影者心情吗
icon.png[狂贺] 贺贺贺贺 贺!岛村卯月!总选举NO.1
icon.png[难过] 羡慕白皮肤的女生
icon.png阅读文章
icon.png[黑特]
icon.png[问题] SBK S1安装於安全帽位置
icon.png[分享] 旧woo100绝版开箱!!
icon.pngRe: [无言] 关於小包卫生纸
icon.png[开箱] E5-2683V3 RX480Strix 快睿C1 简单测试
icon.png[心得] 苍の海贼龙 地狱 执行者16PT
icon.png[售车] 1999年Virage iO 1.8EXi
icon.png[心得] 挑战33 LV10 狮子座pt solo
icon.png[闲聊] 手把手教你不被桶之新手主购教学
icon.png[分享] Civic Type R 量产版官方照无预警流出
icon.png[售车] Golf 4 2.0 银色 自排
icon.png[出售] Graco提篮汽座(有底座)2000元诚可议
icon.png[问题] 请问补牙材质掉了还能再补吗?(台中半年内
icon.png[问题] 44th 单曲 生写竟然都给重复的啊啊!
icon.png[心得] 华南红卡/icash 核卡
icon.png[问题] 拔牙矫正这样正常吗
icon.png[赠送] 老莫高业 初业 102年版
icon.png[情报] 三大行动支付 本季掀战火
icon.png[宝宝] 博客来Amos水蜡笔5/1特价五折
icon.pngRe: [心得] 新鲜人一些面试分享
icon.png[心得] 苍の海贼龙 地狱 麒麟25PT
icon.pngRe: [闲聊] (君の名は。雷慎入) 君名二创漫画翻译
icon.pngRe: [闲聊] OGN中场影片:失踪人口局 (英文字幕)
icon.png[问题] 台湾大哥大4G讯号差
icon.png[出售] [全国]全新千寻侘草LED灯, 水草

请输入看板名称,例如:WOW站内搜寻

TOP