Redian新闻
>
Where can I find the definition of the method: java.lang.System.getProperties().list()
avatar
Where can I find the definition of the method: java.lang.System.getProperties().list()# Java - 爪哇娇娃
r*r
1
Just began to learn Thinking in Java, 4th edition. I read the method in the
title among the following code, but failed to find its definition. Anyone
can give me a hint? Thanks in advance.
----on Page 76 of Thinking in Java, 4th edition -------
//: object/ShowProperties.java
public class ShowProperties {
public static void main(String[] args) {
System.getProperties().list(System.out);
System.out.println(System.getProperty("user.name"));
System.out.println(
System.getProperty("java.library.path"));
}
} ///:~
avatar
r*r
2
In my Eclipse, the default execution environment is JavaSE-1.6, with the
option of JavaSE-1.7 among drop down menu. Should I switch to 1.7? Is it
better?
avatar
T*U
3
system.getproperties() 得到一个properties object.
list(System.out)就把这个object打印到屏幕上面了
http://docs.oracle.com/javase/6/docs/api/java/lang/System.html
http://docs.oracle.com/javase/6/docs/api/java/util/Properties.h

the

【在 r********r 的大作中提到】
: Just began to learn Thinking in Java, 4th edition. I read the method in the
: title among the following code, but failed to find its definition. Anyone
: can give me a hint? Thanks in advance.
: ----on Page 76 of Thinking in Java, 4th edition -------
: //: object/ShowProperties.java
: public class ShowProperties {
: public static void main(String[] args) {
: System.getProperties().list(System.out);
: System.out.println(System.getProperty("user.name"));
: System.out.println(

avatar
T*U
4
估计thinking in java 1.6就够了吧。你看看thinking in java用的是什么版本,各版
本之间可能有些区别,不过一般都是compatible的。主要是1.4 to 1.5变化比较大

【在 r********r 的大作中提到】
: In my Eclipse, the default execution environment is JavaSE-1.6, with the
: option of JavaSE-1.7 among drop down menu. Should I switch to 1.7? Is it
: better?

avatar
r*r
5
Thanks for your explanation. In fact, I have searched and found the
following link is very relevant. Unfortunately, however, it does not include
the definition.
http://docs.oracle.com/javase/1.4.2/docs/api/java/lang/System.h
In general, how can I find the definition of a specific method?

【在 T****U 的大作中提到】
: system.getproperties() 得到一个properties object.
: list(System.out)就把这个object打印到屏幕上面了
: http://docs.oracle.com/javase/6/docs/api/java/lang/System.html
: http://docs.oracle.com/javase/6/docs/api/java/util/Properties.h
:
: the

avatar
r*r
6
Thanks, I got it in the 2nd link.
不过,我不明白的是:list( )是Properties的method,不是getProperties()的method
,怎么能有下面的用法呢?
System.getProperties().list(System.out);

【在 T****U 的大作中提到】
: system.getproperties() 得到一个properties object.
: list(System.out)就把这个object打印到屏幕上面了
: http://docs.oracle.com/javase/6/docs/api/java/lang/System.html
: http://docs.oracle.com/javase/6/docs/api/java/util/Properties.h
:
: the

avatar
T*U
7
优先级的问题,省略了一个括号
(System.getProperties()).list(System.out)
其实也算abuse java的一个例子,
ananymous class里面abuse就更严重了

method

【在 r********r 的大作中提到】
: Thanks, I got it in the 2nd link.
: 不过,我不明白的是:list( )是Properties的method,不是getProperties()的method
: ,怎么能有下面的用法呢?
: System.getProperties().list(System.out);

avatar
r*r
8
Do you imply that ObjectReference.member.submember != (ObjectReference.
member).submember? I had thought they are exactly same!
As a beginner, I appreciate your patience.
avatar
g*g
9
这个算不上什么abuse,优先级一直都是从左到右。这个用法很正常,加括号才奇怪。
就如不写(1+2)+3一样。

【在 T****U 的大作中提到】
: 优先级的问题,省略了一个括号
: (System.getProperties()).list(System.out)
: 其实也算abuse java的一个例子,
: ananymous class里面abuse就更严重了
:
: method

avatar
T*U
10
by "abuse" i mean "易读性差"

【在 g*****g 的大作中提到】
: 这个算不上什么abuse,优先级一直都是从左到右。这个用法很正常,加括号才奇怪。
: 就如不写(1+2)+3一样。

avatar
T*U
11
in your context, submember belongs to member, not to objectReference(there
is no "submember" concept to a Object). So they are same. Think about it
again.【 在 rearBumper (new ID) 的大作中提到: 】
avatar
r*r
12
You are exactly right. I just temporarily fabricated an inappropriate
concept to express my point. Thanks for clarification.
Can I change the "submember" to (member's method)?
相关阅读
logo
联系我们隐私协议©2024 redian.news
Redian新闻
Redian.news刊载任何文章,不代表同意其说法或描述,仅为提供更多信息,也不构成任何建议。文章信息的合法性及真实性由其作者负责,与Redian.news及其运营公司无关。欢迎投稿,如发现稿件侵权,或作者不愿在本网发表文章,请版权拥有者通知本网处理。