of 45/45
Programming Language Study Java IT_Service_LA B In SeoulTech 이이이

Programming java day2

  • View
    16

  • Download
    3

Embed Size (px)

Text of Programming java day2

  1. 1. Programming Language Study IT_Service_LAB In SeoulTech
  2. 2. 1. JDK 2. 3. 4. 5.
  3. 3. : JDK JDK(Java Development Kit) , . http://oracle.com ! 1 JDK
  4. 4. : JDK ! 1 JDK
  5. 5. : JDK 1 JDK
  6. 6. : JDK 1 JDK
  7. 7. : JDK 1 JDK
  8. 8. : JDK 1 JDK
  9. 9. : JDK 1 JDK
  10. 10. : JDK 1 JDK
  11. 11. : JDK 1 JDK
  12. 12. : JDK 1 JDK
  13. 13. : JDK 1. Path 2. 3. *** *** ;C:Program FilesJavajdk1.8.0_45bin 1 JDK
  14. 14. : JDK 1. 2. : JAVA_HOME 3. *** *** bin ;C:Program FilesJavajdk1.8.0_45 1 JDK
  15. 15. : JDK 1. 2. : CLASSPATH 3. *** *** %classpath%;. . 1 JDK
  16. 16. : JDK (CMD) java version . 1 JDK
  17. 17. : JDK : , . http://www.eclipse.org/downloads/ 1 JDK
  18. 18. : JDK . 1 JDK
  19. 19. : JDK eclipse.exe OK 1 JDK
  20. 20. : JDK 1 JDK
  21. 21. . . ? 1 , . CPU (Integer) (String) . Strongly-Typed Language . Python Weakly(Loosely)-typed language . . 2
  22. 22. . , . : 1 byte 8 bit 0 1 8 . , 1 2 8 . byte 1 byte 27 ~27 1 short 2 byte 215 ~215 1 int 4 byte 231 ~231 1 ( ) long 8 byte 263~263 1 ( l) ex) floatValue = 200l; float 4 byte 3.4 1038 ~3.4 1038 ( f ) ex) floatValue = 10.11f; double 8 byte 1.7 10308 ~1.7 10308 ( ) boolean 1 byte true false , char 1 byte 0~28 1( ) ex) a 2
  23. 23. , . (Array). , 1 . 1. : 4 . data_type array_name[ ] ; data_type[ ] array_name ; data_type [ ]array_name ; data_type[ ]array_name ; 2. array_name = new data_type[ size ]; 3. array_name[ index ] = initial_value; 4. array_name.length size. : CPU !!! new 3
  24. 24. size : Index : 0 (size-1). 0 , , . size index .. : 8 int mathScore[ ] ; // mathScore = new int[8]; // mathScore[0] = 83; // mathScore[1] = 50; : mathScore[7] = 99; 3
  25. 25. . 1. data_type array_name[ ] = new data_type[size]; 2. , data_type array_name[ ] = { value1, value2, value3, , value }; : 8 int mathScore[ ] = new int[8]; // Int mathScore[ ] = {83, 50, 71, 67, 22, 41, 45, 99}; //, 3
  26. 26. 1 2 . , (n-1) n , 2 . [ ] . [ ] . , size . : 3(4 ) ( 30) ( 5 ) . , 30 , 4 . int score[ ][ ][ ] = new int[4][5][30]; , 5 30 , 4 . int score[ ][ ][ ] = new int[4][30][5]; 3
  27. 27. , , size . . length . . int score[ ][ ][ ] = new int[4][5][30]; System.out.println(score.length); System.out.println(score[0].length); System.out.println(score[0][0].length); . 4, 5, 30 . 3
  28. 28. . . , . , (Object) . 1. . 2. . (, ) Class_name var_name = new Class_Creater; 3. . ( . ) var_name.attribute char 1 . . , String . 4
  29. 29. : : Score.java 4
  30. 30. : : Example1.java 4
  31. 31. 10 . . , . . . . short Int , short int . , . ) short int -> short int float double -> float double char int -> char int Int float -> int float 5
  32. 32. , . , , int float . . (data_type)variable . 1. : .(Overflow) int short (short)intValue short byte (byte)shortValue 2. : int long (long)intValue byte int (int)byteValue 5
  33. 33. 1. : .(Overflow) double float (float)doubleValue 2. : float double (double)floatValue char int (int)charValue char . . , . char B = 'b'+('A'-'a'); 5
  34. 34. : . 1. String byteValue = Byte.valueOf(stringValue).byteValue(); shortValue = Short. valueOf(stringValue).shortValue(); intValue = Integer. valueOf(stringValue).intValue(); longValue = Long. valueOf(stringValue).longValue(); floatValue = Float. valueOf(stringValue).floatValue(); doubleValue = Double. valueOf(stringValue).doubleValue(); booleanValue = Boolean. valueOf(stringValue).booleanValue(); 2. String stringValue = String.valueOf(byteValue); stringValue = String.valueOf(shortValue); stringValue = String.valueOf(intValue); stringValue = String.valueOf(longValue); stringValue = String.valueOf(floatValue); stringValue = String.valueOf(doubleValue); stringValue = String.valueOf(booleanValue); 5
  35. 35. 1 2 3 4 5 . . println . .
  36. 36. 1 2 3 4 5 . . 1. , 2. , ( , ) byte short int long float double boolean char String
  37. 37. 1 2 3 4 5
  38. 38. 1 2 3 4 5
  39. 39. 1 2 3 4 5 1. , 50 53 48 34 19 34 48 83 87 91 75 39 73 43 33 91 73 73 83 72 55 51 64 66 41 67 37 71 83 57
  40. 40. 1 2 3 4 5 2. , 12 34 56 78 89 1 2 3 4 5 10 20 30 40 50 60 70 80 90 10 5 4 3 2 1 9 8 7 6 5 50 53 48 34 19 34 48 83 87 91 75 39 73 43 33 91 73 73 83 72 55 51 64 66 41 67 37 71 83 57 10 30 50 70 90 1 2 3 4 5 6 7 8 9 1 51 52 53 54 55 10 10 10 10 10 15 18 19 20 20
  41. 41. 1 2 3 4 5
  42. 42. 1 2 3 4 5
  43. 43. 1 2 3 4 5 : Student.java () : , , , , : , : : Excute.java 10111234 , .
  44. 44. 1 2 3 4 5
  45. 45. IT_Service_LAB In SeoulTech