JAVA PROGRAMMING - PowerPoint PPT Presentation

1 / 39
About This Presentation
Title:

JAVA PROGRAMMING

Description:

Title: JAVA PROGRAMMING Author: Accords Last modified by: Accords Created Date: 7/4/2006 4:37:49 AM Document presentation format: On-screen Show Company – PowerPoint PPT presentation

Number of Views:27
Avg rating:3.0/5.0
Slides: 40
Provided by: Acco157
Category:

less

Transcript and Presenter's Notes

Title: JAVA PROGRAMMING


1
JAVA PROGRAMMING
  • ???????????????????????? ????????????

2
JAVA
3
?????????????????????????? JAVA
4
?????????
  • http//java.sun.com/j2se/1.5.0/download-netbeans.
    html

5
PATH
  • PATH ????????????????????????????????????????
    ?????

1
2
6
START TO JAVA
  • ???????????????????????

7
??????
Comment
Import Statements
  • public class ________
  • public static void main(String args)
  • ___________________________

Class Name
Method Body
8
??????????????????????? Java
1. ???????????????? ???????? ???????????
Underscore ( _ ) ??? dollar signs ( )2.
???????????????????????3. ????????????4.
???????????????????? ???????????? ????????????
???????? ???????????????????????????????????????
??? (Variables) ????????? (Method) ????????
9
Comment
  • ?????? 3 ??????
  • 1. / / ???????????? / ??????????????
    ?????????? /
  • 2. // This is a comment
  • 3. /
  • This is a comment line 1
  • This is a comment line 2
  • /

10
(No Transcript)
11
1. ??????
  • ?????? ??? ??????????????????????????????????????
    ?? ???????????????????????????????????????????????
    ????

12
??????????????? (Variables Declaration)
?????????????
?????????????
int x
13
1.3 ???????????????????? (Assignment)
?????????????
?????????????
????????????
int x 10
???????? ?????????????????????????????????????
Initialization
14
1.3 ???????????????????? (???)
sum firstNumber secondNumbersolution x
x-2 x1char ch1, ch2 xString name
Mickey
???????? ???????????????????????????????????????
??????????????
15
1.3 ???????????????????? (???)
???????????????????????? x ??? y ????????????
1 ?????????????????????????? x y
1 ?????????????????????? x 1 y 1
16
1.3 ???????????????????? (???)
???????????????????????? x ???????????? 3
?????????????????????????? x
3 ?????????????????????? x x 3
17
1.4 ??????????????????????
????????????????????????????????? x ???
1?????????????????????????? x
?????????????????????? x x1 ?????????????
???????????????????? x ??? 1??????????????????
???????? x-- ?????????????????????? x x-1
18
1.4 ?????????????????????? (???)
count 7 y count
y count
count count1
19
1.4 ?????????????????????? (???)
count 7 y count
count
7
count count1
y count
20
??????????? 1
21
??????????? 2
22
2. ?????????????
???????????????????
1
????????????????
2
????????????
3
?????????
4
23
2.1 ????????????????????????????
  • 1. byte ?????????????????????????????? -128
    ??? 1282. short ??????????????????????????????-
    32768 ??? 32767
  • 3. int ??????????????????????????????
  • -2147483648 ??? 2147483647
  • 4. long ??????????????????????????????
  • -922337206854775808 ??? 922337206854775807

24
2.2 ?????????????????????????
  • 1. float ??????????????????????????????
    -3.40282347E38 ??? 3.40282347E38 2.
    double ??????????????????????????????
    -1.797769313486231570E308 ???
    1.797769313486231570E308

25
2.3 ???????????????????????????
  • 1. char ???????????????????????????????????????
    ?? 1 ??? ???? a A ???? 5 ???????
    2. String ????????????????????????????????????
    ???????

26
??????????? ???????????
27
2.4 ????????????????????????
  • ???????????????????????????????
    ????????????????? 2 ??? ??? ???? (true) ???
    ???? (false) ?????????????????????????? boolean

28
????????????????
29
OPERATER
  • ???????????

30
3. ?????????????????????????
Operator ????????????????????????? Java
?????? ?????? - ????? ?????? / ???
??? ????????????
31
3.1 Integer Division
??????????????????????? / ???? -
??????????????????????????????????????????????
????????????????????????????- ???????????????????
??????????????????????????????????????????????????
??22 / 5 4 22 / 5.0 4.4 25.0 / 5.0
5.023 5 3 23 25 23 15.5 4 3.5
32
???????? 1
33
???????? 2
34
(No Transcript)
35
3.2 ???????????????
????
?????? ( ) unary operator - , ??????
??? , / , ?????? ?? , -
????
???????? ???????????????????????????????????????
??????????
36
3.3 ???????????????????????
1. Implicit Conversion ?????????????????????????
?????????? ??????????????????????????????????????
?????? ???? ????????????????????????????????????
???? ???????????????????????????2. Explicit
Conversion ??????????????????????????????????????
???????????? ????????????????????????????????????
????????? ( ) ????????????????????
???????????????????????????????
37
??????????? 3
???????????????????? ??????? Explicit Conversion
int ch 88char letter Xch (int)
letterletter (char) 56
int money 2.3 1.4money (int)2.3
(int)1.4
38
Thank You !
  • ???? ITSMRT

39
  • a ( b - ( c / d ) / e ) ( f g h )
Write a Comment
User Comments (0)
About PowerShow.com