forked from DuGuQiuBai/Java
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
e28d1b6
commit b717533
Showing
4 changed files
with
259 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,80 @@ | ||
1����������� | ||
�������չ | ||
�����Ӳ�� | ||
��������� | ||
��������� | ||
java���ԣ���ƽ̨�ԣ���ȫ�� | ||
James Gosling:java֮�� | ||
|
||
2�����ÿ���̨���� | ||
�̷� ð�� �س������뵽ij������ | ||
cd ����Ŀ¼ | ||
cd �༶Ŀ¼ | ||
dir ��ʾĿ¼�µ������ļ� | ||
md ����Ŀ¼ | ||
rd ɾ��Ŀ¼ | ||
cls ���� | ||
exit �˳� | ||
���䣺rd -sɾ����ʱ��ѯ�� | ||
rd -q -sֱ��ɾ����ѯ�� | ||
|
||
3��JVM��JRE,JDK���ߵ������ϵ | ||
JVM:java���������֤��java���ԵĿ�ƽ̨�ͣ�Ϊ��ͬ�IJ���ϵͳ�ṩ��ͬ��JVM | ||
JRE:����ʱ����������JVM�ͺ������ | ||
JDK���������߰�������JRE�Ϳ������� | ||
|
||
4��JDK�����أ���װ��ж�� | ||
|
||
5���������� | ||
path��Ϊ������exe�ļ���������Ŀ¼������ | ||
��ʽ�� | ||
(1)�ڻ���������path������javac��java���ڵ�Ŀ¼����������ǰ�棬�ж���ᰴ˳����� | ||
(2)������������JAVA_HOMEΪexeĿ¼���ڣ�path:%JAVA_HOME%\bin;ԭ����·�� | ||
|
||
classpath��Ϊ����class�ļ���������ָ��Ŀ¼������ | ||
|
||
6��HelloWorld���� | ||
|
||
7�� | ||
8�� | ||
9�� | ||
10��ע�� | ||
ע�ͷ��ࣺ | ||
����ע�� // | ||
����ע�� /* */ | ||
�ĵ�ע�� /** */ | ||
|
||
ע�͵����ã� | ||
����˵���ĵ�����ߴ���Ŀ��Ķ��� | ||
�������Գ��� | ||
|
||
11���ؼ��� | ||
java�����б����ľ������⺬��ĵ��� | ||
|
||
�����ؼ��� | ||
|
||
ע����� | ||
goto��const��java�еĹؼ��ֱ��������Dz�δʹ�� | ||
|
||
|
||
12����ʶ�� | ||
��ʶ�������ڸ��࣬�ӿڣ����������������ķ��� | ||
|
||
��ɹ��� | ||
Ӣ�Ĵ�Сд��ĸ | ||
���� | ||
_��$ | ||
ע����� | ||
���������ֿ�ͷ | ||
�����ǹؼ��� | ||
�ϸ����ִ�Сд | ||
|
||
������������ | ||
���������ļ��У����ڽ����ͬ���������� | ||
ȫ��Сд | ||
|
||
����߽ӿڣ�ÿһ������ĸ��д(��һ����API���ṩ�����ӿ������������淶) | ||
|
||
�������߱�����������Сд�������д | ||
|
||
��������д���������֮����_���� |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,73 @@ | ||
1������ | ||
�Զ��峣������������ | ||
����ֵ������ | ||
�ַ��� | ||
�ַ� | ||
���� | ||
���������� | ||
null���ճ��� | ||
|
||
2������ת�� | ||
���ƣ� | ||
�����ƣ�0b | ||
�˽��ƣ�0 | ||
ʮ�����ƣ�0x | ||
|
||
�������Ƶ�ʮ���ƣ� | ||
ϵ��*����^Ȩ�η�֮�� | ||
|
||
ʮ���Ƶ��������ƣ� | ||
����ȡ��ֱ����Ϊ�㣬������ת | ||
|
||
8421�룺����ת�� | ||
|
||
3���з������������ʾ | ||
ԭ�룺�����Ʊ�ʾ | ||
����������λ0 ����������λ1 | ||
���룺������ԭ��һ�� ��������λΪ1������λ��λȡ�� | ||
���룺������ԭ��һ�� �����ɷ����1 | ||
|
||
|
||
4�������������� | ||
������֣� | ||
byte 1 | ||
short 2 | ||
int 4 | ||
long 8 | ||
|
||
boolean 1 | ||
char 2 | ||
float 4 | ||
double 8 | ||
|
||
Ĭ��������int����������double | ||
����long�ͣ�ĩβ��l����L(�Ƽ����ô�д��) | ||
����float�ͣ�ĩβ��f����F | ||
|
||
�����������ͣ� | ||
���飬�࣬�ӿ� | ||
|
||
5������ | ||
����ִ�й���ֵ�ᷢ���仯���� | ||
|
||
6������ת�� | ||
��ʽ����ת�� | ||
byte��short��char->int->long->float->double | ||
|
||
longΪʲô��ת����float�� | ||
float�ײ�洢�ṹ��ͬ | ||
��ʾ�����ݷ�Χfloat���� | ||
ע�����������ӣ��ȼ��ٿ��ռ� | ||
������ӣ��ȿ��ռ��ټ� | ||
ǿ������ת�� | ||
������ | ||
|
||
7����ֵ����� | ||
8����������� | ||
+-*/% ++ --�������Լ�����ǰ���������� | ||
+= -= *= /= %= | ||
9����ϵ����� | ||
>< == >= <= != | ||
10��������� | ||
& | ! ^ | ||
&& ||�������� |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
1����Ŀ����� |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,105 @@ | ||
1���쳣 | ||
�쳣�������쳣�dz�����ֲ���������� | ||
������г����Σ�������� | ||
�쳣���ࣺ | ||
Throwable | ||
|---Error | ||
|---Exception | ||
|---RuntimeException ����ʱ�쳣 ���Դ�����Ҳ���Բ����� ��Ҫ�Ĵ��� | ||
|---��RuntimeException ����ʱ�쳣 ���봦����������ͨ������ | ||
|
||
�쳣������ʽ�� | ||
JVMĬ�ϴ����ķ�ʽ���������쳣����Ϣ�������̨������������ | ||
A��try...catch...finally... | ||
���ֱ���ʹ�ã�try�����catch��finally�е�һ�����ʹ�� | ||
finally���ص㣺��finally���Ƶ�����嶼��ִ�� | ||
ע�����finally���Ƶ����ֻҪ��JVM�˳�֮ǰ����ִ�� | ||
|
||
B��throws | ||
���ܴ������쳣�����׳���һ�����main�����еõ��������main���������� ����JVM | ||
|
||
�쳣��ע����� | ||
JDK7�������ԣ� | ||
catch(�쳣1 | �쳣2 |... e):����쳣 | ||
try...catch���ж��catch���ʱ����Χ��������쳣����������һ�� | ||
|
||
�����쳣������ֻ���׳��븸����ͬ�쳣�������ڸ����쳣�����쳣 | ||
����쳣������ֻ���׳��븸����ͬ�쳣�������ڸ����쳣�����쳣���� | ||
û���쳣������û���׳��쳣������Ҳ�����׳��쳣 | ||
|
||
�Զ����쳣�� | ||
����̳���RuntimeException����Exception�� | ||
�������׳��Զ����쳣 | ||
public class MyException extends Exception { | ||
public MyException() { | ||
super(); | ||
} | ||
public MyException(String message) { | ||
super(message);//�������Ϣ�Ĺ��췽�� | ||
} | ||
} | ||
|
||
�����⣺final��finalize��finally������ | ||
final����ʾ���յ����η� | ||
�����ࣺ��ܱ��̳� | ||
���γ�Ա�������������ܱ���д | ||
���γ�Ա������������Ϊ���� | ||
finalize��Object��ķ��������ڵ�������������������������System��� gc()��������һ�� | ||
finally�����쳣������try...catch...finally���ʹ�ã��쳣�����ǻ�ִ�� �Ĵ��� | ||
|
||
throws��throw������ | ||
throws�����������ϣ���������������������׳�����쳣�ö��Ÿ�������ʾ �����쳣�Ŀ����� | ||
throw������������������ֻ��һ������ʾ����ij�־�����쳣 | ||
|
||
finally�е�������return֮ǰ����֮��ִ�� | ||
return�����ص㣬����һ������·�� | ||
|
||
2��File�� | ||
���������ڱ�ʾ�ļ������ļ��е��� | ||
|
||
���췽���� | ||
public File(String pathname) | ||
public File(String parent,String filename) | ||
public File(File file, String name) | ||
public File(URI uri):ͳһ��Դ��λ�������Դ�ͨ������·�������ļ������ļ��ж� �� | ||
|
||
��Ա������ | ||
�������ܣ� | ||
public boolean createNewFile():�������ļ� | ||
public boolean mkdir():��������Ŀ¼ | ||
public boolean mkdirs():�������Ŀ¼ | ||
|
||
ɾ�����ܣ� | ||
public boolean delete():ɾ��ִ���ļ����ļ��� | ||
ɾ�����ص㣺ɾ����������վ��ֱ��ɾ�� | ||
|
||
�жϹ��ܣ� | ||
public boolean isDirectory():�ж��Ƿ�Ϊ�ļ��� | ||
public boolean isFile():�ж��Ƿ�Ϊ�ļ� | ||
public boolean exists():�ж��Ƿ���� | ||
public boolean canWrite():�Ƿ��д | ||
public boolean canRead():�Ƿ�ɶ� | ||
public boolean isHidden():�Ƿ����� | ||
���������ܣ� | ||
public boolean rename(String dest):��������·����ͬ��������·����ͬ ���к������� | ||
|
||
��ȡ���ܣ� | ||
public String getAbsolutePath(): | ||
public String getName(): | ||
public String getPath(): | ||
public int length():��ȡ�ļ���С | ||
public long lastModified():�����ʱ��ĺ���ֵ | ||
����ȡ���ܣ� | ||
public String[] list():�ַ�����洢ij��Ŀ¼�������ļ����ļ��� | ||
public File[] listFile():�ļ�����洢ij��Ŀ¼�������ļ����ļ��� | ||
|
||
�ļ��������� | ||
public String[] list(fileNameFilter filter): | ||
public File[] listFile(fileNameFilter filter): | ||
fileNameFilter�������ڲ��࣬��дaccept���� | ||
new fileNameFilter(){ | ||
public boolean accept(File dir,String name){ | ||
return new file().isFile() && name.endswit(".jpg"); | ||
} | ||
} | ||
���������ijĿ¼������JPG��β���ļ� |