当前在线人数16131
首页 - 分类讨论区 - 电脑网络 - 葵花宝典版 - 同主题阅读文章

此篇文章共收到打赏
0

  • 10
  • 20
  • 50
  • 100
您目前伪币余额:0
未名交友
[更多]
[更多]
expression in Java
[版面:葵花宝典][首篇作者:scififi] , 2005年03月17日20:23:59 ,707次阅读,1次回复
来APP回复,赚取更多伪币 关注本站公众号:
[分页:1 ]
scififi
进入未名形象秀
我的博客
[回复] [回信给作者] [本篇全文] [本讨论区] [修改] [删除] [转寄] [转贴] [收藏] [举报] [ 1 ]

发信人: scififi (What are you looking at?), 信区: Programming
标  题: expression in Java
发信站: Unknown Space - 未名空间 (Thu Mar 17 20:23:59 2005) WWW-POST

String b = "\u000A"; is syntax error.

String b = "\u0009"; is right,
String b = "\u001A"; is right too.
why?

How to input "\u000A" into a variable?

thx


--
※ 来源:.Unknown Space - 未名空间 mitbbs.com.[FROM: 207.38.]

 
deepbeep
进入未名形象秀
我的博客
[回复] [回信给作者] [本篇全文] [本讨论区] [修改] [删除] [转寄] [转贴] [收藏] [举报] [ 2 ]

发信人: deepbeep (咪咪豆), 信区: Programming
标  题: Re: expression in Java
发信站: Unknown Space - 未名空间 (Thu Mar 17 22:00:11 2005), 转信

http://java.sun.com/docs/books/jls/second_edition/html/lexical.doc.html#100960

Because Unicode escapes are processed very early, it is not correct to
write '\u000a' for a character literal whose value is linefeed (LF); the
Unicode escape \u000a is transformed into an actual linefeed in translation
step 1 (§3.3) and the linefeed becomes a LineTerminator in step 2 (§3.4),
and so the character literal is not valid in step 3. Instead, one should
use the escape sequence '\n' (§3.10.6). Similarly, it is not correct to
write '\u000d' for a character literal whose value is carriage return (CR).
Instead, use '\r'.

【 在 scififi (What are you looking at?) 的大作中提到: 】 : String b = "\u000A"; is syntax error.
: String b = "\u0009"; is right,
: String b = "\u001A"; is right too.
: why?
: How to input "\u000A" into a variable?
: thx


--
※ 来源:.Unknown Space - 未名空间 mitbbs.com.[FROM: 69.22.]

[分页:1 ]
[快速返回] [ 进入葵花宝典讨论区] [返回顶部]
回复文章
标题:
内 容:

未名交友
将您的链接放在这儿

友情链接


 

Site Map - Contact Us - Terms and Conditions - Privacy Policy

版权所有,未名空间(mitbbs.com),since 1996