1 / 31

Chapter 1 Java Fundamentals

Chapter 1 Java Fundamentals. XIANG ZHANG javacose@gmail.com. Content. Evolution of Java JDK and JRE Java Operating Mechanism Java Developing Environment Java Primary Data Types Java Basic Grammar. Evolution of Java – Success of OOP. from《Beyond Java》. Evolution of Java – Life of Java.

uriel
Télécharger la présentation

Chapter 1 Java Fundamentals

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Chapter 1 Java Fundamentals XIANG ZHANG javacose@gmail.com

  2. Content • Evolution of Java • JDKand JRE • JavaOperating Mechanism • JavaDeveloping Environment • JavaPrimary Data Types • JavaBasic Grammar COSE Java

  3. Evolution of Java – Success of OOP from《Beyond Java》 COSE Java

  4. Evolution of Java – Life of Java • Past • Resource-limited Device • C++ • Green Project • Oak • Mosaic / Mark Ardreesen • HotJava • Present • Internet / WWW • Future • Sun与Microsoft • Java与开源 • Java与Oracle COSE Java

  5. JDKand JRE • JDK – Java Development Toolkit • J2SE – Java 2 Standard Edition • J2EE – Java 2 Enterprise Edition • J2ME – Java 2 Micro Edition • JRE – Java Runtime Environment 1-5 COSE Java

  6. JavaMechanism – Traditional COSE Java

  7. JavaMechanism – Java COSE Java

  8. JavaDeveloping Environment • Text editor • IDE • JCreator • JBuilder • *Eclipse • Netbeans • IntelliJ IDEA • MyEclipse 1-8 COSE Java

  9. Eclipse COSE Java

  10. JavaFeatures • Simplicity: simple grammar, rich library • Pure OO: everything is object! • Security: memory access, garbage collection, exception • Portability: Java Virtual Machine • Interpreted execution: Bytecode COSE Java

  11. Exploring Java COSE Java

  12. Java Primary Data Types COSE Java

  13. JavaPrimary Data Types COSE Java

  14. Conversion Between Values • From Low Accuracy to High Accuracy: Auto double d = 10; • From High Accuracy to Low Accuracy: Cast int t = (int)10.2; COSE Java

  15. Primary Types and Wrapper • Values of Primary Types are NOT Objects! • Each Primary type has a corresponding wrapper to wrap a value into an object: • Integer a = 473; • System.out.println(a.compareTo(new Integer(472))); COSE Java

  16. Variables and Constants • Declare and use • Lifecycle and Hidden Variables COSE Java

  17. Notice! • Different with C++ COSE Java

  18. 其余部分 首字母 变 量 名 任意多的: 1、数字 2、字母 3、下划线‘_’ 4、‘$’ 符号 1、字母 2、下划线‘_’ 3、‘$’符号 Naming of Variables • Principle: • A names should reflect the meaning of a variable • Precise • First letter in lower case (different with classes) COSE Java

  19. JavaOperator • Arithmetic operator • Comparison operator • Logical operator • Bitwise operator • Assignment operator • Others COSE Java

  20. Arithmetic Operator • +、- 、* 、/ 、% • ++ 、- - COSE Java

  21. Comparison Operator • > 、>= • < 、<= • == 、!= • instanceof COSE Java

  22. Logical Operator • &、| • &&、|| • ! • ^ COSE Java

  23. Bitwise Operator • << • >> • >>> 1-23 COSE Java

  24. Assignment Operator • = • += 、-= 、*= 、/= 、% = • >>= 、<<= 、>>> = COSE Java

  25. Others • ? : • . • new • [] COSE Java

  26. JavaGrammar • Package • Import • Class • Field • Method COSE Java

  27. JavaStatement • if-else • switch • while、do-while • for • break • continue • return COSE Java

  28. JavaKeywords abstract assert boolean break byte case catch char class const continue default do double interface long native new null package private protected public return short static strictfp super else enum extends false final finally float for goto if implements import instanceof int switch synchronized this throw throws transient true try void volatile while COSE Java

  29. JavaComments COSE Java

  30. Self-teaching • Javadoc • What is Javadoc? • How to add comments in program for making a Javadoc? • How to generate Javadoc in HTML format? • How to search in Javadoc? COSE Java

  31. Forecast • OO Concepts • Class and Objects • Package • Field • Method • Mainmethod • Object • Construct and Initialization • Access Control COSE Java

More Related