Содержание
- 2. Objectives To review computer basics, programs, and operating systems (§§1.2-1.4). To explore the relationship between Java
- 3. What is a Computer? A computer consists of a CPU, memory, hard disk, floppy disk, monitor,
- 4. CPU The central processing unit (CPU) is the brain of a computer. It retrieves instructions from
- 5. Memory Memory is to store data and program instructions for CPU to execute. A memory unit
- 6. How Data is Stored? Data of various kinds, such as numbers, characters, and strings, are encoded
- 7. Storage Devices Memory is volatile, because information is lost when the power is off. Programs and
- 8. Output Devices: Monitor The monitor displays information (text and graphics). The resolution and dot pitch determine
- 9. Monitor Resolution and Dot Pitch The resolution specifies the number of pixels per square inch. Pixels
- 10. Communication Devices A regular modem uses a phone line and can transfer data in a speed
- 11. Programs Computer programs, known as software, are instructions to the computer. You tell a computer what
- 12. Programming Languages Machine Language Assembly Language High-Level Language Machine language is a set of primitive instructions
- 13. Programming Languages Machine Language Assembly Language High-Level Language Assembly languages were developed to make programming easy.
- 14. Programming Languages Machine Language Assembly Language High-Level Language The high-level languages are English-like and easy to
- 15. Popular High-Level Languages COBOL (COmmon Business Oriented Language) FORTRAN (FORmula TRANslation) BASIC (Beginner All-purpose Symbolic Instructional
- 16. Compiling Source Code A program written in a high-level language is called a source program. Since
- 17. Operating Systems The operating system (OS) is a program that manages and controls a computer’s activities.
- 18. Why Java? The answer is that Java enables users to develop and deploy applications on the
- 19. Java, Web, and Beyond Java can be used to develop Web applications. Java Applets Java Web
- 20. Examples of Java’s Versatility (Applets)
- 21. PDA and Cell Phone
- 22. Java’s History James Gosling and Sun Microsystems Oak Java, May 20, 1995, Sun World HotJava The
- 23. Characteristics of Java Java Is Simple Java Is Object-Oriented Java Is Distributed Java Is Interpreted Java
- 24. Characteristics of Java Java Is Simple Java Is Object-Oriented Java Is Distributed Java Is Interpreted Java
- 25. Characteristics of Java Java Is Simple Java Is Object-Oriented Java Is Distributed Java Is Interpreted Java
- 26. Characteristics of Java Java Is Simple Java Is Object-Oriented Java Is Distributed Java Is Interpreted Java
- 27. Characteristics of Java Java Is Simple Java Is Object-Oriented Java Is Distributed Java Is Interpreted Java
- 28. Characteristics of Java Java Is Simple Java Is Object-Oriented Java Is Distributed Java Is Interpreted Java
- 29. Characteristics of Java Java Is Simple Java Is Object-Oriented Java Is Distributed Java Is Interpreted Java
- 30. Characteristics of Java Java Is Simple Java Is Object-Oriented Java Is Distributed Java Is Interpreted Java
- 31. Characteristics of Java Java Is Simple Java Is Object-Oriented Java Is Distributed Java Is Interpreted Java
- 32. Characteristics of Java Java Is Simple Java Is Object-Oriented Java Is Distributed Java Is Interpreted Java
- 33. Characteristics of Java Java Is Simple Java Is Object-Oriented Java Is Distributed Java Is Interpreted Java
- 34. Characteristics of Java Java Is Simple Java Is Object-Oriented Java Is Distributed Java Is Interpreted Java
- 35. JDK Versions JDK 1.02 (1995) JDK 1.1 (1996) JDK 1.2 (1998) JDK 1.3 (2000) JDK 1.4
- 36. JDK Editions Java Standard Edition (J2SE) J2SE can be used to develop client-side standalone applications or
- 37. Popular Java IDEs NetBeans Open Source by Sun Eclipse Open Source by IBM
- 38. A Simple Java Program //This program prints Welcome to Java! public class Welcome { public static
- 39. Creating and Editing Using NotePad To use NotePad, type notepad Welcome.java from the DOS prompt.
- 40. Creating and Editing Using WordPad To use WordPad, type write Welcome.java from the DOS prompt.
- 41. Creating, Compiling, and Running Programs
- 42. Compiling Java Source Code You can port a source program to any machine with appropriate compilers.
- 43. //This program prints Welcome to Java! public class Welcome { public static void main(String[] args) {
- 44. //This program prints Welcome to Java! public class Welcome { public static void main(String[] args) {
- 45. //This program prints Welcome to Java! public class Welcome { public static void main(String[] args) {
- 46. Two More Simple Examples Run Welcome1 Run ComputeExpression
- 47. Supplements on the Companion Website See Supplement I.B for installing and configuring JDK See Supplement I.C
- 48. Compiling and Running Java from the Command Window Set path to JDK bin directory set path=c:\Program
- 49. Compiling and Running Java from TextPad See Supplement II.A on the Website for details Companion Website
- 50. Compiling and Running Java from JBuilder See Supplement II.H on the Website for details Companion Website
- 51. Compiling and Running Java from NetBeans See Supplement I.D on the Website for details Companion Website
- 52. Anatomy of a Java Program Comments Reserved words Modifiers Statements Blocks Classes Methods The main method
- 53. Comments Line comment: A line comment is preceded by two slashes (//) in a line. Paragraph
- 54. Reserved Words Reserved words or keywords are words that have a specific meaning to the compiler
- 55. Modifiers Java uses certain reserved words called modifiers that specify the properties of the data, methods,
- 56. Statements A statement represents an action or a sequence of actions. The statement System.out.println("Welcome to Java!")
- 57. Blocks A pair of braces in a program forms a block that groups components of a
- 58. Classes The class is the essential Java construct. A class is a template or blueprint for
- 59. Methods What is System.out.println? It is a method: a collection of statements that performs a sequence
- 60. main Method The main method provides the control of program flow. The Java interpreter executes the
- 61. Displaying Text in a Message Dialog Box you can use the showMessageDialog method in the JOptionPane
- 62. The showMessageDialog Method JOptionPane.showMessageDialog(null, "Welcome to Java!", "Display Message", JOptionPane.INFORMATION_MESSAGE);
- 64. Скачать презентацию