Java开发网 Java开发网
注册 | 登录 | 帮助 | 搜索 | 排行榜 | 发帖统计  

您没有登录

» Java开发网 » 科技英语  

按打印兼容模式打印这个话题 打印话题    把这个话题寄给朋友 寄给朋友    该主题的所有更新都将Email到你的邮箱 订阅主题
flat modethreaded modego to previous topicgo to next topicgo to back
作者 Literals and Ranges 是什么意思?
zerol

Soul of New Machine



发贴: 593
于 2004-01-19 22:05 user profilesend a private message to usersearch all posts byselect and copy to clipboard. 
ie only, sorry for netscape users:-)add this post to my favorite list
在这句话中:

Literals and Ranges of All Primitive Data Types.

Literals and Ranges 是什么意思?

TIA



★☆ The Truth Lies Somewhere In The Middle ☆★ 
作者 Re:Literals and Ranges 是什么意思? [Re:zerol]
dorrenchen





发贴: 298
于 2004-01-20 11:51 user profilesend a private message to usersearch all posts byselect and copy to clipboard. 
ie only, sorry for netscape users:-)add this post to my favorite list
From 金山词霸,definition of literal is "A letter or symbol that represents a particular constant or number, known or unknown, and is not programmer-defined."

so in java,
[code]
// variables a, b, c are are literals.
int a=1;
float b = 2.3;
String c ="abc";
[/code]

in perl, you can declare an array with a shortcut:
letters = ['a'..'z'];
which declares array of letters with values from a to z. Such range definition is not available in java, maybe in jdk 1.5?



作者 Re:Literals and Ranges 是什么意思? [Re:zerol]
yuhuang



CJSDN高级会员


发贴: 212
于 2004-02-03 15:34 user profilesend a private message to usersearch all posts byselect and copy to clipboard. 
ie only, sorry for netscape users:-)add this post to my favorite list
我的理解是:
Literals and Ranges指常量和范围。ranges好懂。literal如果从字典里查,它是形容词,这里是作名词用,就相当于我们汉语说程序设计里的常量为“文字量”或者说“字面值”。字典中还没有收录这样的用法,但是我觉得对这个词的理解应该很重要,我们说“常量”,也许概念上有多种理解,但是说“文字量”或“字面值”,就好理解了吧,native speaker对于literal的理解应该类似于此吧。
希望大家能将自己有较深理解的基础性的词汇拿出来共同进步!



作者 Re:Literals and Ranges 是什么意思? [Re:zerol]
jigsaw

KK

CJSDN高级会员


发贴: 3666
于 2004-02-03 16:41 user profilesend a private message to usersearch all posts byselect and copy to clipboard. 
ie only, sorry for netscape users:-)add this post to my favorite list
I'm afraid dorrenchen's explanation is not quite right.Tongue

A literal is a value specified in the program source, as opposed to one
determined at runtime. Literals can represent primitive or string variables,
and may appear on the right side of assignments or in method calls. You
cannot assign a value into a literal, so they cannot appear on the left side
of an assignment.

boolean Literals : true, false;
char Literals : 'a', 'c' ...
Integral Literals : 10, 500, -9 ...
Floating-Point Literals : 1.414, 7.828f, 4.2E + 3
String Literals : "AString", "AnotherString", ....

ranges指:
byte : -27 -- 27-1
etc...


jigsaw edited on 2004-02-03 16:45

No one knows except both of us.
909090909090909090909090909090909090909090b8533ce76c8d6c241868968a0408c338b4ffbf
ISO/IEC 9899:1999
作者 Re:Literals and Ranges 是什么意思? [Re:zerol]
dorrenchen





发贴: 298
于 2004-02-06 07:11 user profilesend a private message to usersearch all posts byselect and copy to clipboard. 
ie only, sorry for netscape users:-)add this post to my favorite list
good point. I had variable and literals mixed up.



flat modethreaded modego to previous topicgo to next topicgo to back
  已读帖子
  新的帖子
  被删除的帖子
Jump to the top of page

   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