当前位置: 技术问答>java相关
石头问问题,
来源: 互联网 发布时间:2014-12-28
本文导语: 1 有关JAVA的类型,我在JDK1。3里看到一种文件是 类型是EXECUTABLE JAR FILE,它的打开方式是JAVAW,这个文件可以直接点击运行,请问这个跟所谓的可执行文件有什么区别,它是什么东西,能否具体讲讲。 2 有个。JAV...
1 有关JAVA的类型,我在JDK1。3里看到一种文件是 类型是EXECUTABLE JAR FILE,它的打开方式是JAVAW,这个文件可以直接点击运行,请问这个跟所谓的可执行文件有什么区别,它是什么东西,能否具体讲讲。
2 有个。JAVA的程序是SimpleExample.java 编译后生成SimpleExample$RadioListener.class 和SimpleExample$1.class,请问生成的这两个文件名字怎么这么奇怪,这个程序是JDK1。3里面附带的。
3 BufferedReader in =new BufferedReader (new InputScreemReader(System.in)); 帮我分析一下,这句。越具体越好。
呵呵我是菜鸟,谢谢帮忙,能回答多少就回到多少,谢谢。
呵呵。。。。。。。。。。
2 有个。JAVA的程序是SimpleExample.java 编译后生成SimpleExample$RadioListener.class 和SimpleExample$1.class,请问生成的这两个文件名字怎么这么奇怪,这个程序是JDK1。3里面附带的。
3 BufferedReader in =new BufferedReader (new InputScreemReader(System.in)); 帮我分析一下,这句。越具体越好。
呵呵我是菜鸟,谢谢帮忙,能回答多少就回到多少,谢谢。
呵呵。。。。。。。。。。
|
2.那是内部类。
3.BufferedReader is a filter reader class.
That is, it wraps another reader and reading from it is like reading from the reader it wraps, except
that it changes something.
In the case of BufferedReader, it reads in large chunks and then you can retrieve its data in smaller
bits. To use it to read from System.in, you first need a reader to wrap. You can bridge from an
input stream (which System.in is) to a reader by using an InputStreamReader.
Then wrap that in a BufferedReader as follows:
BufferedReader input =
new BufferedReader(new InputStreamReader(System.in));
Now you can call methods of BufferedReader to read from standard input. Generally, you create a
BufferedReader to be able to call the readLine() method. That isn't BufferedReader's main intended
use -- the main intended use is performance -- but you don't generally care too awfully much about
performance of reads from the console. So call readLine to get a line of input, which will be null on
end of stream (user presses Ctrl-D on UNIX or a file was redirected in and is done).
3.BufferedReader is a filter reader class.
That is, it wraps another reader and reading from it is like reading from the reader it wraps, except
that it changes something.
In the case of BufferedReader, it reads in large chunks and then you can retrieve its data in smaller
bits. To use it to read from System.in, you first need a reader to wrap. You can bridge from an
input stream (which System.in is) to a reader by using an InputStreamReader.
Then wrap that in a BufferedReader as follows:
BufferedReader input =
new BufferedReader(new InputStreamReader(System.in));
Now you can call methods of BufferedReader to read from standard input. Generally, you create a
BufferedReader to be able to call the readLine() method. That isn't BufferedReader's main intended
use -- the main intended use is performance -- but you don't generally care too awfully much about
performance of reads from the console. So call readLine to get a line of input, which will be null on
end of stream (user presses Ctrl-D on UNIX or a file was redirected in and is done).
|
2. example:
class A{
int a;
class B{
int b;
}
}
这样生成的就是A$B.class
class A{
int a;
class B{
int b;
}
}
这样生成的就是A$B.class