際際滷

際際滷Share a Scribd company logo
于仂亟仆亶 从 于 Java
                       舒仆亳亠 1



仍亠从舒仆亟 亳仆
e-mail: alexander.rusin@gmail.com
Android Developer
丐亠仆仂仍仂亞亳亳

      Java SE  Java Standard Edition, 仂仆仂于仆仂亠
    亳亰亟舒仆亳亠 Java, 仂亟亠亢亳 从仂仄仗亳仍仂, API,
    Java Runtime Environment; 仗仂亟仂亟亳 亟仍
    仂亰亟舒仆亳 仗仂仍亰仂于舒亠仍从亳 仗亳仍仂亢亠仆亳亶, 于
    仗亠于 仂亠亠亟  亟仍 仆舒仂仍仆 亳亠仄.

      Java EE  Java Enterprise Edition,
    仗亠亟舒于仍磳 仂弍仂亶 仆舒弍仂 仗亠亳亳从舒亳亶
    亟仍 仂亰亟舒仆亳 仗仂亞舒仄仄仆仂亞仂 仂弍亠仗亠亠仆亳
    仂于仆 仗亠亟仗亳亳.
丐亠仆仂仍仂亞亳亳

       Java ME  Java Micro Edition, 仂亰亟舒仆舒 亟仍
    亳仗仂仍亰仂于舒仆亳 于 仂亶于舒, 仂亞舒仆亳亠仆仆 仗仂
    于亳仍亳亠仍仆仂亶 仄仂仆仂亳, 仆舒仗亳仄亠 于 仄仂弍亳仍仆
    亠仍亠仂仆舒, , 于仂亠仆仆 亳亠仄舒;

       JavaFX  亠仆仂仍仂亞亳, 磦仍ム舒 仍亠亟ム亳仄
    舒亞仂仄 于 于仂仍ム亳亳 Java 从舒从 Rich Client Platform;
    仗亠亟仆舒亰仆舒亠仆舒 亟仍 仂亰亟舒仆亳 亞舒亳亠从亳 亳仆亠亠亶仂于
    从仂仗仂舒亳于仆 仗亳仍仂亢亠仆亳亶 亳 弍亳亰仆亠舒.

       Java Card  亠仆仂仍仂亞亳 仗亠亟仂舒于仍磳 弍亠亰仂仗舒仆
    亠亟 亟仍 仗亳仍仂亢亠仆亳亶, 舒弍仂舒ム亳 仆舒 仄舒-从舒舒 亳 
    亟亞亳 仂亶于舒  仂亠仆 仂亞舒仆亳亠仆仆仄 仂弍亠仄仂仄
    仗舒仄亳 亳 于仂亰仄仂亢仆仂礆亳 仂弍舒弍仂从亳.
仂亠亶舒 仗仂亞舒仄仄舒 仆舒 Java

public class Main {
     /** 丐仂从舒 于仂亟舒 于 仗仂亞舒仄仄 */
     public static void main(String[] args) {
         // 于于仂亟 于 从仂仆仂仍
         System.out.println("Hello World");
     }
}
弍磦仍亠仆亳亠 仗亠亠仄亠仆仆
丐亳仗_仗亠亠仄亠仆仆仂亶 亳仄_仗亠亠仄亠仆仆仂亶;
int value1;
int value2;
int sum_value;
仆仂于仆亠 舒仆亟舒仆亠 亳仗 Java
丶亠仍亠  int, short, long
弌亳仄于仂仍仆亶  char
仂亞亳亠从亳亶  boolean
亠亠于亠仆仆亠  float, double
于仂亟/于于仂亟 亰仆舒亠仆亳亶 仗亠亠仄亠仆仆
    int value1;
    double value2;
    int sum_value;
//弌仂亰亟舒亠仄 仂弍亠从 br 亟仍 亠仆亳 亟舒仆仆 亳亰 弍亠舒
    BufferedReader br = new BufferedReader(new
   InputStreamReader(System.in));
//丼亳舒亠仄 亳亰 从仂仆仂仍亳 Double
    value2 = Double.parseDouble(br.readLine());
// 丼亳舒亠仄 亳亰 从仂仆仂仍亳 Int
    value1 = Integer.parseInt(br.readLine());
// 于于仂亟 于 从仂仆仂仍
    System.out.println(sum_value);
舒亰于亳仍从舒
if (仍仂于仆仂亠_于舒亢亠仆亳亠)
    亠亶于亳亠_1
else
    亠亶于亳亠_2
亳仄亠
if (val1 > val2) {
    max_val = val1;
}
else {
    max_val = val2;
}
丶亳从仍  仗亠亟仍仂于亳亠仄
while (仍仂于仆仂亠_于舒亢亠仆亳亠) {
  亠亶于亳亠;
}
亳仄亠
i = 1;
while (i <= 10) {
   System.out.print(i + " ");
   i = i + 1;
}
亳仄亠
i = 1;
while (i <= 10) {
   System.out.print(i + " ");
   i = i + 1;
}
舒亟舒舒 仗仂 亳从仍 WHILE
于仂亟: 亠仍仂亠 亳仍仂
于仂亟: 仗仂仂亠 仂仆仂 亳仍亳 仂舒于仆仂亠

舒亠仄舒亳从舒: 仗仂仂亠 亳仍仂 亟亠仍亳 仂仍从仂
 舒仄仂 仆舒 亠弍 亳 仆舒 1.
丶亳从仍  仗仂仍仂于亳亠仄
do {
   亠亶于亳亠;
} while (仍仂于仆仂亠_于舒亢亠仆亳亠);
亳仄亠
int f = 1;
int i = 1;

do {
  f = f * i;
  i = i + 1;
} while (i <= n);
舒亟舒舒 仗仂 亳从仍 DO  WHILE
于仂亟: 仗仂仍亠亟仂于舒亠仍仆仂 亠仍 亳亠仍.
 舒于亠舒亠 仗仂仍亠亟仂于舒亠仍仆仂 0
于仂亟: 仄仄舒 于于亠亟亠仆仆 亳亠仍

亟亠 仗亳仄亠仆亳仄仂: 仗仂亟亳舒 仂亳仄仂 于舒亠亶
 舒亳 亰舒从舒亰舒 (仗仂仂 仗仂仄仄亳仂于舒于 亳
 亳亰 亠从舒).
舒亳于
//仆亳亳舒仍亳亰舒亳 仄舒亳于舒
  int month_days [];
  int month_days[] = { 31, 28, 31, 30, 31, 31, 30, 31, 30, 31 };
//亟亠仍亠仆亳亠 仗舒仄亳 仗仂亟 12 仍亠仄亠仆仂于 仄舒亳于舒
  month_days = new int [12];
//舒亟舒仆亳亠 亰仆舒亠仆亳亶 仄舒亳于舒
  month_days[0] = 31;
  month_days[1] = 28;
  month_days[2] = 31;
  month_days[3] = 30;
  month_days[4] = 31;
于仄亠仆亠 仄舒亳于
//仆亳亳舒仍亳亰舒亳 仄舒亳于舒
  double matrix [][] = new double [4][4];
  int matrix[][] = {{ 0*0, 1*0, 2*0, 3*0 }, { 0*1, 1*1, 2*1, 3*1 },
                   { 0*2, 1*2, 2*2, 3*2 }, { 0*3, 1*3, 2*3, 3*3 } };
//亟亠仍亠仆亳亠 仗舒仄亳 仗仂亟 仍亠仄亠仆 仄舒亳于舒
  matrix = new double [4] [];
//舒亟舒仆亳亠 亰仆舒亠仆亳亶 仄舒亳于舒
  matrix = new double[4][4];
  matrix[0][0] = 1;
  matrix[1][1] = 1;
  matrix[2][2] = 1;
仂仄舒仆亠亠 亰舒亟舒仆亳亠

    丕舒仆仂于亳 IDE(亢亠仍舒亠仍仆仂 Eclipse)

    仂亠亳 http://www.java2s.com/Code/Java/JDK-6 亳
    亰舒仗亳 2 - 3 从仂仆仂仍仆 仗亳仄亠舒.

    舒亟舒舒 1. 仂仍亰仂于舒亠仍 于 从仂仆仂仍亳 于于仂亟亳
    亳仄 束alex損, 仆舒亢亳仄舒亠 束Enter損, 于 从仂仆仂仍
    于于仂亟亳 束Hi, alex!!!損

    舒亟舒舒 2. 舒亰弍亳 亠亠仆亳亠 从于舒亟舒仆仂亞仂
    舒于仆亠仆亳 仆舒 从仍舒(仄仂亟仍亳).
亳亠舒舒
弌舒亳

    http://kostin.ws/java/java-loops.html (亳从仍)

    http://litvinuke.hut.ru/articles/Java03.htm

    http://www.javable.com/tutorials/fesunov/lesson4/

    http://ru.wikipedia.org/wiki/Java
亳亠舒舒
弌舒亳

    http://kostin.ws/java/java-loops.html (亳从仍)

    http://litvinuke.hut.ru/articles/Java03.htm (亳仆舒从亳)

    http://www.javable.com/tutorials/fesunov/lesson4/ (亳仆舒从亳)

    http://ru.wikipedia.org/wiki/Java (仂弍舒舒 亳仆仂仄舒亳)
亳亠舒舒
仆仄亠仆
  Eclipse classic
  http://www.eclipse.org/downloads/
  SDK
  http://www.oracle.com/technetwork/java/javase/downloads/index.html
  Android SDK
  http://developer.android.com/sdk/index.html
仆亳亞亳
  Java 2 (. 仂仂仆, . 丿亳仍亟, 2005)
  Swing: 从仂于仂亟于仂 亟仍 仆舒亳仆舒ム亳(亠弍亠 丿亳仍亟, 2007)
  Google Android. 仂亞舒仄仄亳仂于舒仆亳亠 亟仍 仄仂弍亳仍仆
  仂亶于.(仍亠从亠亶 仂仍仂舒仗仂于 2011亞)
弌仗舒亳弍仂 亰舒 于仆亳仄舒仆亳亠!

More Related Content

Lec 1

  • 1. 于仂亟仆亶 从 于 Java 舒仆亳亠 1 仍亠从舒仆亟 亳仆 e-mail: alexander.rusin@gmail.com Android Developer
  • 2. 丐亠仆仂仍仂亞亳亳 Java SE Java Standard Edition, 仂仆仂于仆仂亠 亳亰亟舒仆亳亠 Java, 仂亟亠亢亳 从仂仄仗亳仍仂, API, Java Runtime Environment; 仗仂亟仂亟亳 亟仍 仂亰亟舒仆亳 仗仂仍亰仂于舒亠仍从亳 仗亳仍仂亢亠仆亳亶, 于 仗亠于 仂亠亠亟 亟仍 仆舒仂仍仆 亳亠仄. Java EE Java Enterprise Edition, 仗亠亟舒于仍磳 仂弍仂亶 仆舒弍仂 仗亠亳亳从舒亳亶 亟仍 仂亰亟舒仆亳 仗仂亞舒仄仄仆仂亞仂 仂弍亠仗亠亠仆亳 仂于仆 仗亠亟仗亳亳.
  • 3. 丐亠仆仂仍仂亞亳亳 Java ME Java Micro Edition, 仂亰亟舒仆舒 亟仍 亳仗仂仍亰仂于舒仆亳 于 仂亶于舒, 仂亞舒仆亳亠仆仆 仗仂 于亳仍亳亠仍仆仂亶 仄仂仆仂亳, 仆舒仗亳仄亠 于 仄仂弍亳仍仆 亠仍亠仂仆舒, , 于仂亠仆仆 亳亠仄舒; JavaFX 亠仆仂仍仂亞亳, 磦仍ム舒 仍亠亟ム亳仄 舒亞仂仄 于 于仂仍ム亳亳 Java 从舒从 Rich Client Platform; 仗亠亟仆舒亰仆舒亠仆舒 亟仍 仂亰亟舒仆亳 亞舒亳亠从亳 亳仆亠亠亶仂于 从仂仗仂舒亳于仆 仗亳仍仂亢亠仆亳亶 亳 弍亳亰仆亠舒. Java Card 亠仆仂仍仂亞亳 仗亠亟仂舒于仍磳 弍亠亰仂仗舒仆 亠亟 亟仍 仗亳仍仂亢亠仆亳亶, 舒弍仂舒ム亳 仆舒 仄舒-从舒舒 亳 亟亞亳 仂亶于舒 仂亠仆 仂亞舒仆亳亠仆仆仄 仂弍亠仄仂仄 仗舒仄亳 亳 于仂亰仄仂亢仆仂礆亳 仂弍舒弍仂从亳.
  • 4. 仂亠亶舒 仗仂亞舒仄仄舒 仆舒 Java public class Main { /** 丐仂从舒 于仂亟舒 于 仗仂亞舒仄仄 */ public static void main(String[] args) { // 于于仂亟 于 从仂仆仂仍 System.out.println("Hello World"); } }
  • 6. 仆仂于仆亠 舒仆亟舒仆亠 亳仗 Java 丶亠仍亠 int, short, long 弌亳仄于仂仍仆亶 char 仂亞亳亠从亳亶 boolean 亠亠于亠仆仆亠 float, double
  • 7. 于仂亟/于于仂亟 亰仆舒亠仆亳亶 仗亠亠仄亠仆仆 int value1; double value2; int sum_value; //弌仂亰亟舒亠仄 仂弍亠从 br 亟仍 亠仆亳 亟舒仆仆 亳亰 弍亠舒 BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); //丼亳舒亠仄 亳亰 从仂仆仂仍亳 Double value2 = Double.parseDouble(br.readLine()); // 丼亳舒亠仄 亳亰 从仂仆仂仍亳 Int value1 = Integer.parseInt(br.readLine()); // 于于仂亟 于 从仂仆仂仍 System.out.println(sum_value);
  • 9. 亳仄亠 if (val1 > val2) { max_val = val1; } else { max_val = val2; }
  • 10. 丶亳从仍 仗亠亟仍仂于亳亠仄 while (仍仂于仆仂亠_于舒亢亠仆亳亠) { 亠亶于亳亠; }
  • 11. 亳仄亠 i = 1; while (i <= 10) { System.out.print(i + " "); i = i + 1; }
  • 12. 亳仄亠 i = 1; while (i <= 10) { System.out.print(i + " "); i = i + 1; }
  • 13. 舒亟舒舒 仗仂 亳从仍 WHILE 于仂亟: 亠仍仂亠 亳仍仂 于仂亟: 仗仂仂亠 仂仆仂 亳仍亳 仂舒于仆仂亠 舒亠仄舒亳从舒: 仗仂仂亠 亳仍仂 亟亠仍亳 仂仍从仂 舒仄仂 仆舒 亠弍 亳 仆舒 1.
  • 14. 丶亳从仍 仗仂仍仂于亳亠仄 do { 亠亶于亳亠; } while (仍仂于仆仂亠_于舒亢亠仆亳亠);
  • 15. 亳仄亠 int f = 1; int i = 1; do { f = f * i; i = i + 1; } while (i <= n);
  • 16. 舒亟舒舒 仗仂 亳从仍 DO WHILE 于仂亟: 仗仂仍亠亟仂于舒亠仍仆仂 亠仍 亳亠仍. 舒于亠舒亠 仗仂仍亠亟仂于舒亠仍仆仂 0 于仂亟: 仄仄舒 于于亠亟亠仆仆 亳亠仍 亟亠 仗亳仄亠仆亳仄仂: 仗仂亟亳舒 仂亳仄仂 于舒亠亶 舒亳 亰舒从舒亰舒 (仗仂仂 仗仂仄仄亳仂于舒于 亳 亳亰 亠从舒).
  • 17. 舒亳于 //仆亳亳舒仍亳亰舒亳 仄舒亳于舒 int month_days []; int month_days[] = { 31, 28, 31, 30, 31, 31, 30, 31, 30, 31 }; //亟亠仍亠仆亳亠 仗舒仄亳 仗仂亟 12 仍亠仄亠仆仂于 仄舒亳于舒 month_days = new int [12]; //舒亟舒仆亳亠 亰仆舒亠仆亳亶 仄舒亳于舒 month_days[0] = 31; month_days[1] = 28; month_days[2] = 31; month_days[3] = 30; month_days[4] = 31;
  • 18. 于仄亠仆亠 仄舒亳于 //仆亳亳舒仍亳亰舒亳 仄舒亳于舒 double matrix [][] = new double [4][4]; int matrix[][] = {{ 0*0, 1*0, 2*0, 3*0 }, { 0*1, 1*1, 2*1, 3*1 }, { 0*2, 1*2, 2*2, 3*2 }, { 0*3, 1*3, 2*3, 3*3 } }; //亟亠仍亠仆亳亠 仗舒仄亳 仗仂亟 仍亠仄亠仆 仄舒亳于舒 matrix = new double [4] []; //舒亟舒仆亳亠 亰仆舒亠仆亳亶 仄舒亳于舒 matrix = new double[4][4]; matrix[0][0] = 1; matrix[1][1] = 1; matrix[2][2] = 1;
  • 19. 仂仄舒仆亠亠 亰舒亟舒仆亳亠 丕舒仆仂于亳 IDE(亢亠仍舒亠仍仆仂 Eclipse) 仂亠亳 http://www.java2s.com/Code/Java/JDK-6 亳 亰舒仗亳 2 - 3 从仂仆仂仍仆 仗亳仄亠舒. 舒亟舒舒 1. 仂仍亰仂于舒亠仍 于 从仂仆仂仍亳 于于仂亟亳 亳仄 束alex損, 仆舒亢亳仄舒亠 束Enter損, 于 从仂仆仂仍 于于仂亟亳 束Hi, alex!!!損 舒亟舒舒 2. 舒亰弍亳 亠亠仆亳亠 从于舒亟舒仆仂亞仂 舒于仆亠仆亳 仆舒 从仍舒(仄仂亟仍亳).
  • 20. 亳亠舒舒 弌舒亳 http://kostin.ws/java/java-loops.html (亳从仍) http://litvinuke.hut.ru/articles/Java03.htm http://www.javable.com/tutorials/fesunov/lesson4/ http://ru.wikipedia.org/wiki/Java
  • 21. 亳亠舒舒 弌舒亳 http://kostin.ws/java/java-loops.html (亳从仍) http://litvinuke.hut.ru/articles/Java03.htm (亳仆舒从亳) http://www.javable.com/tutorials/fesunov/lesson4/ (亳仆舒从亳) http://ru.wikipedia.org/wiki/Java (仂弍舒舒 亳仆仂仄舒亳)
  • 22. 亳亠舒舒 仆仄亠仆 Eclipse classic http://www.eclipse.org/downloads/ SDK http://www.oracle.com/technetwork/java/javase/downloads/index.html Android SDK http://developer.android.com/sdk/index.html 仆亳亞亳 Java 2 (. 仂仂仆, . 丿亳仍亟, 2005) Swing: 从仂于仂亟于仂 亟仍 仆舒亳仆舒ム亳(亠弍亠 丿亳仍亟, 2007) Google Android. 仂亞舒仄仄亳仂于舒仆亳亠 亟仍 仄仂弍亳仍仆 仂亶于.(仍亠从亠亶 仂仍仂舒仗仂于 2011亞)