Skip to content

Commit 0e5c44c

Browse files
committed
Java第一天
1 parent 807129e commit 0e5c44c

18 files changed

+404
-0
lines changed
2.22 MB
Binary file not shown.
429 Bytes
Binary file not shown.
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
class HelloWorld {
2+
public static void main(String[] args) {
3+
System.out.println("ÎÒ°®ÁÖÇàϼ");
4+
}
5+
}
420 Bytes
Binary file not shown.
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
//注释:用于解释说明程序的文字
2+
/*
3+
注释的分类:
4+
单行注释 一般用于解释说明单行程序
5+
格式是://注释文字
6+
多行注释 一般用于解释说明多行程序
7+
格式是:
8+
文档注释 一般是对类或者方法进行说明,被javadoc工具解析生产一个文档说明书。
9+
格式是:
10+
*/
11+
12+
//注意:多行注释不能嵌套写,而单行注释可以。
13+
14+
//这是我的学生案例
15+
//class是java中用来定义类的
16+
//定义类的格式是:class 类名
17+
18+
/*
19+
这是我的学生案例
20+
class是java中用来定义类的
21+
定义类的格式是:class 类名
22+
*/
23+
24+
/** */
25+
class Student {
26+
public static void main(String[] args) {
27+
System.out.println("我是学生");
28+
}
29+
}
Binary file not shown.
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
/*
2+
注释的作用:
3+
A:解释说明程序,提高程序的阅读性
4+
B:可以帮助我们调试程序
5+
*/
6+
class Demo {
7+
public static void main(String[] args) {
8+
System.out.println("HelloWorld");
9+
System.out.println("我爱林青霞");
10+
System.out.println("我爱Java");
11+
System.out.println("我爱张瑜");
12+
}
13+
}
Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
/*
2+
需求:我要完成HelloWorld案例
3+
4+
分析:
5+
A:java语言最基本的单位是类,所以我们首先要定义一个类
6+
B:java程序要想能够独立运行,必须有主方法
7+
C:如果想要程序有输出,必须有输出语句
8+
9+
步骤:
10+
A:定义类的格式
11+
class 类名 {
12+
//类体
13+
}
14+
B:主方法的格式
15+
public static void main(String[] args) {
16+
//方法体
17+
}
18+
C:输出语句的格式
19+
System.out.println("这里的内容是可以改");
20+
21+
最后把我们的思想用代码给体现出来
22+
*/
23+
//这是我的带注释的HelloWorld案例
24+
//class用来定义类
25+
class HelloWorld {
26+
/*
27+
这是main方法
28+
main方法是程序的入口
29+
jvm会自动调用main方法
30+
*/
31+
public static void main(String[] args) {
32+
//这是输出语句
33+
System.out.println("HelloWorld");
34+
}
35+
}

day01/code/03_关键字/KeyWord.java

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
/*
2+
关键字:被Java语言赋予特定含义的单词
3+
4+
关键字的特点:关键字都是小写的
5+
6+
关键字注意事项
7+
A:goto和const作为保留字存在,目前并不使用
8+
B:类似Editplus这样的高级记事本,针对关键字有特殊的颜色标记,非常直观
9+
*/
10+
class KeyWord {
11+
public static void main(String[] args) {
12+
System.out.println("HelloWorld");
13+
}
14+
}

day01/code/04_标识符/NameDemo.java

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
/*
2+
标识符:就是给类,接口,方法,变量等起名字时使用的字符序列(字符串)
3+
4+
组成规则:
5+
A:英文字母大小写
6+
B:数字
7+
C:_和$
8+
9+
注意事项:
10+
A:不能以数字开头
11+
B:不能是Java中的关键字
12+
C:区分大小写
13+
Student,student 这是两个名称
14+
15+
常见的命名规则:见名知意
16+
A:包 其实就是文件夹,用于解决相同类名问题
17+
全部小写
18+
单级:com
19+
多级:cn.itcast
20+
21+
B:类或者接口
22+
一个单词:首字母大写
23+
Student,Person,Teacher
24+
多个单词:每个单词的首字母大写
25+
HelloWorld,MyName,NameDemo
26+
27+
C:方法或者变量
28+
一个单词:全部小写
29+
name,age,show()
30+
多个单词:从第二个单词开始,每个单词首字母大写
31+
myName,showAllStudentNames()
32+
33+
D:常量
34+
一个单词:全部大写
35+
AGE
36+
多个单词:每个单词都大写,用_连接
37+
STUDENT_MAX_AGE
38+
*/
39+
class NameDemo {
40+
public static void main(String[] args) {
41+
System.out.println("Hello World!");
42+
}
43+
}

day01/code/04_标识符/基础班/Student.txt

Whitespace-only changes.

day01/code/04_标识符/就业班/Student.txt

Whitespace-only changes.

day01/day01总结.txt

Lines changed: 181 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,181 @@
1+
1:���������(�˽�)
2+
(1)�����
3+
(2)�����Ӳ��
4+
(3)���������
5+
(4)��������
6+
(5)���������
7+
(6)�˻�������ʽ(����)
8+
A:ͼ�λ����淽ʽ
9+
B:�����з�ʽ
10+
(7)���̵Ĺ��ܼ���ʶ
11+
(8)���õĿ�ݼ�(���� �Լ������ݼ�)
12+
A:ȫѡ
13+
B:����
14+
C:ճ��
15+
D:����
16+
E:����
17+
F:����
18+
19+
2:DOS����(����)
20+
(1)�л��̷�(����)
21+
d: �س�
22+
(2)��ʾijĿ¼�µ������ļ������ļ���(����)
23+
dir �س�
24+
(3)�������
25+
md �ļ������� �س�
26+
(4)ɾ���ļ���
27+
rd �ļ������� �س�
28+
(5)����Ŀ¼(����)
29+
�������� cd Ŀ¼����
30+
�༶���� cd Ŀ¼����1\Ŀ¼����2\...
31+
(6)����Ŀ¼(����)
32+
�������� cd..
33+
���˸�Ŀ¼ cd\
34+
(7)ɾ���ļ�
35+
del �����
36+
*.txt ���Ա�ʾ����ļ�����
37+
(8)����(����)
38+
cls
39+
(9)�˳�
40+
exit
41+
(10)��չDOS����
42+
ɾ�������ݵ��ļ���
43+
rd /s �ļ������� ����ʾ�Ƿ�ɾ��
44+
rd /q /s �ļ������� ֱ��ɾ��
45+
46+
3:Java���Է�չʷ(�˽�)
47+
(1)Java֮��
48+
(2)JDK�İ汾
49+
1.4.2
50+
1.5
51+
1.6
52+
1.7
53+
1.8
54+
(3)Java���Ե�ƽ̨
55+
JavaSE
56+
JavaEE
57+
JavaME(Android)
58+
(4)Java���Ե��ص�
59+
60+
4:JDK,JRE,JVM(����)
61+
(1)JVM
62+
��֤Java���Կ�ƽ̨����Բ�ͬ�IJ���ϵͳ�ṩ��ͬ��JVM��
63+
64+
���⣺java�����ǿ�ƽ̨����?JVM�ǿ�ƽ̨����?
65+
(2)JRE
66+
java��������л���������JVM�ͺ������
67+
(3)JDK
68+
java��������������JRE�Ϳ�������(javac,java)
69+
70+
5:JDK�����أ���װ��ж��(����)
71+
(1)����
72+
���������أ����߰ٶ�Ҳ���ԡ�
73+
(2)��װ
74+
��װ�� ������һ������װ���ɡ���������һ�㽨�鲻Ҫ�пո�����ġ�
75+
��ɫ�� ��ѹ�Ϳ���ʹ��
76+
(3)�
77+
��װ�� ͨ��360���߿������
78+
��ɫ�� ֱ��ɾ���ļ��м���
79+
80+
6:HelloWorld����(����)
81+
(1)���
82+
class HelloWorld {
83+
public static void main(String[] args) {
84+
System.out.println("HelloWorld");
85+
}
86+
}
87+
(2)���͸ó���
88+
A:class������������ģ���ʽ��: class ���� {}
89+
B:����Ҫ�������У�����������������ʽ�ǣ�
90+
public static void main(String[] args) { }
91+
C:����Ҫ������ݣ������������䣬��ʽ�ǣ�
92+
System.out.println("HelloWorld");
93+
(3)����ı��������
94+
A:javac���������򣬺���������ļ�����
95+
javac HelloWorld.java
96+
B:java����ִ�г��򣬺��������class�ļ����ƣ�������չ��
97+
java HelloWorld
98+
(4)һ��Java����Ŀ�������
99+
A:��дJavaԴ����
100+
B:ͨ��javac�������java���������ֽ����ļ�
101+
C:ͨ��java���������ֽ����ļ�
102+
103+
7:HelloWorld������������(����)
104+
(1)�ļ������������Բ�һ�£����ǽ���һ��
105+
(2)�Ҳ����ļ�
106+
(3)����д����(������Сд��ƴд)
107+
(4)����ƥ�����⣬������д�����ʱ�򣬳ɶ�д����
108+
(5)��Ӣ�����⣬java����һ�㶼��Ӣ��״̬��
109+
(6)ĩβȱ�ٷֺ�
110+
111+
8:path��������(����)
112+
(1)ΪʲôҪ����path��������
113+
Ϊ����javac��java�������������Ŀ¼��ʹ��
114+
(2)�������
115+
A:��ʽ1 ֱ���޸�path����ǰ��׷��JDK��binĿ¼
116+
B:��ʽ2(����)
117+
�½�JAVA_HOME: JDK�İ�װĿ¼
118+
�޸�path: %JAVA_HOME%\bin;��������ǰ�Ļ�������
119+
120+
9:classpath��������(����)
121+
(1)ΪʲôҪ����classpath��������
122+
Ϊ����class�ļ�����������Ŀ¼������
123+
(2)�������
124+
�½���classpath��������Ҫ������Ŀ¼�����е�class�ļ�����Ŀ¼���ù�ȥ���ɡ�
125+
ע�⣺������ִ�е�ʱ�����Ⱥ�˳���ϵ
126+
(3)path��classpath������
127+
path��Ϊ����exe�ļ�����������Ŀ¼������
128+
classpath��Ϊ����class�ļ�����������Ŀ¼������
129+
130+
(10)ע��(����)
131+
(1)ע��:���ڽ���˵�����������
132+
(2)���ࣺ
133+
A:���У�//ע������
134+
B:���У�/* ע������ */
135+
C:�ĵ�ע�ͣ�/** ע������ */
136+
(3)��ע�͵�HelloWorld����
137+
(4)ע�͵����ã�
138+
A:����˵��������߳�����Ķ���
139+
B:�������ǵ��Գ���
140+
141+
(11)�ؼ���(����)
142+
(1)�ؼ���:��Java�����ض�����ĵ���
143+
(2)�ص�:ȫ��Сд
144+
(3)ע�����
145+
A:goto��const��Ϊ�����ִ��ڣ�Ŀǰ��ʹ��
146+
B:������Editplus�����ĸ߼����±�����Թؼ�����������ɫ��ǣ��������
147+
148+
(12)��ʶ��(����)
149+
(1)��ʶ�������࣬�ӿڣ��������߱��������ֵķ���
150+
(2)��ɹ���
151+
A:Ӣ����ĸ��Сд
152+
B:����
153+
C:_��$
154+
(3)ע�����
155+
A:���������ֿ�ͷ
156+
B:������Java�еĹؼ���
157+
C:���ִ�Сд
158+
Student,student ������������
159+
(4)����������ʽ��
160+
A:�� ��ʵ�����ļ���,���ڽ����ͬ��������
161+
ȫ��Сд
162+
������com
163+
�༶��cn.itcast
164+
165+
B:����߽ӿ�
166+
һ�����ʣ�����ĸ��д
167+
Student,Person,Teacher
168+
������ʣ�ÿ�����ʵ�����ĸ��д
169+
HelloWorld,MyName,NameDemo
170+
171+
C:�������߱���
172+
һ�����ʣ�ȫ��Сд
173+
name,age,show()
174+
������ʣ��ӵڶ������ʿ�ʼ��ÿ����������ĸ��д
175+
myName,showAllStudentNames()
176+
177+
D:����
178+
һ�����ʣ�ȫ����д
179+
AGE
180+
������ʣ�ÿ�����ʶ���д����_����
181+
STUDENT_MAX_AGE

day01/javac命令的配置.jpg

51.4 KB
Loading

day01/java命令的配置.jpg

52.4 KB
Loading

day01/第一章_Java概述.ppt

593 KB
Binary file not shown.
1.48 MB
Binary file not shown.

0 commit comments

Comments
 (0)