由买买提看人间百态

boards

本页内容为未名空间相应帖子的节选和存档,一周内的贴子最多显示50字,超过一周显示500字 访问原贴
Java版 - Where can I find the definition of the method: java.lang.System.getProperties().list()
相关主题
折腾了一天,实在是绝望了,请教请教java reflecton question: how to represent a String[] class?
说说clone咋违反了类继承的原则来的?增加点难度 java core
java Stringjava这个是什么逻辑?
weird class definition问个primitive type的问题
FFDTRe: weird class definitiona simple java programming question
Spring Library Bug?A question about inheritance
overloading methodsHelp: web service questions
线程hardy会一直等待下去么?synchronized method does lock the object that passed into the method as a parameter?
相关话题的讨论汇总
话题: method话题: definition话题: where话题: list话题: java
进入Java版参与讨论
1 (共1页)
r********r
发帖数: 208
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"));
}
} ///:~
r********r
发帖数: 208
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?
T****U
发帖数: 3344
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(

T****U
发帖数: 3344
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?

r********r
发帖数: 208
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

r********r
发帖数: 208
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

T****U
发帖数: 3344
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);

r********r
发帖数: 208
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.
g*****g
发帖数: 34805
9
这个算不上什么abuse,优先级一直都是从左到右。这个用法很正常,加括号才奇怪。
就如不写(1+2)+3一样。

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

T****U
发帖数: 3344
10
by "abuse" i mean "易读性差"

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

T****U
发帖数: 3344
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) 的大作中提到: 】
r********r
发帖数: 208
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)?
1 (共1页)
进入Java版参与讨论
相关主题
synchronized method does lock the object that passed into the method as a parameter?FFDTRe: weird class definition
CC150 16.6答案是不是有问题? (转载)Spring Library Bug?
java class definition and implementationoverloading methods
override/overload/overwrite in Java线程hardy会一直等待下去么?
折腾了一天,实在是绝望了,请教请教java reflecton question: how to represent a String[] class?
说说clone咋违反了类继承的原则来的?增加点难度 java core
java Stringjava这个是什么逻辑?
weird class definition问个primitive type的问题
相关话题的讨论汇总
话题: method话题: definition话题: where话题: list话题: java