Tài liệu hạn chế xem trước, để xem đầy đủ mời bạn chọn Tải xuống
1
/ 164 trang
THÔNG TIN TÀI LIỆU
Thông tin cơ bản
Định dạng
Số trang
164
Dung lượng
1,57 MB
Nội dung
08/13/14 Võ Phương Bình - ITFAC - DLU 1 Chapter 1: Introduction to Java Chapter 2: Primitive Data Types and Operations Chapter 3: Control Statements Chapter 4: Methods Chapter 5: Arrays Part I: Fundamentals of Programming 08/13/14 Võ Phương Bình - ITFAC - DLU 2 Chapter 1: Introduction to Java What Is Java? Getting Started With Java Programming Create, Compile and Running a Java Application 08/13/14 Võ Phương Bình - ITFAC - DLU 3 What Is Java? History Applications of Java Compare to C/C++/C# Characteristics of Java 08/13/14 Võ Phương Bình - ITFAC - DLU 4 History James Gosling and Sun Microsystems (1983-1984) Oak In a project of electric device developing Java, May 20, 1995, Sun World HotJava The first Java-enabled Web browser JDK Evolutions J2SE, J2ME, and J2EE 08/13/14 Võ Phương Bình - ITFAC - DLU 5 JDK Versions JDK 1.0 (1995) JDK 1.1 (1996) Java 2 SDK v 1.2 (JDK 1.2, 1998) Java 2 SDK v 1.3 (JDK 1.3, 2000) Java 2 SDK v 1.4 (JDK 1.4, 2002) Java 5 SDK v 1.5 (JDK 1.5, 2005) 08/13/14 Võ Phương Bình - ITFAC - DLU 6 JDK Editions Java Standard Edition (J2SE) J2SE can be used to develop client-side standalone applications or applets. Java Enterprise Edition (J2EE) J2EE can be used to develop server-side applications such as Java servlets and Java ServerPages. Java Micro Edition (J2ME). J2ME can be used to develop applications for mobile devices such as cell phones. JDK Editions (2) 08/13/14 Võ Phương Bình - ITFAC - DLU 7 Java2 Standard Edition (J2SE™) Java2 Enterprise Edition (J2EE™) Java2 Micro Edition (J2ME™) Java 2 Platform Standard desktop & workstation applications Heavy duty server systems Small & memory constrained devices 08/13/14 Võ Phương Bình - ITFAC - DLU 8 Java IDE Tools Eclipse Borland Jbuilder NetBean Microsoft Visual J++, J# WebGain Café IBM Visual Age for Java Forte by Sun Microsystems 08/13/14 Võ Phương Bình - ITFAC - DLU 9 Applications of Java JAVA Mobile Mobile Console Console GUI GUI Network Network Web Web Database Database RMI RMI Applet Applet 08/13/14 Võ Phương Bình - ITFAC - DLU 10 Console [...]... Phương Bình - ITFAC - DLU 17 Characteristics of Java Java is simple Java is object-oriented Java is distributed Java is robust Java is secure Java is architecture-neutral Java is multithreaded Java is dynamic 08/13/14 Võ Phương Bình - ITFAC - DLU 18 Getting Started with Java Programming A Simple Java Application Compiling Programs Executing Applications 08/13/14 Võ Phương Bình -... What is System.out.println "Welcome to Java!"? It is a method: a collection of statements that performs a sequence of operations to display a message on the console It can be used even without fully understanding the details of how it works 08/13/14 Võ Phương Bình - ITFAC - DLU 32 main Method The main method provides the control of program flow The Java interpreter executes the application by invoking... Võ Phương Bình - ITFAC - DLU 28 Statements Similar to C/C++, every statement in Java ends with a semicolon (;) 08/13/14 Võ Phương Bình - ITFAC - DLU 29 Blocks A pair of braces in a program forms a block that groups components of a program public class Test { public static void main(String[] args) { System.out.println("Welcome to Java!"); } } 08/13/14 Võ Phương Bình - ITFAC - DLU Class block Method... Java!"); } } 08/13/14 Võ Phương Bình - ITFAC - DLU 20 Creating and Compiling Programs Create/Modify Source Code On command line javac file.java Source Code Compile Source Code i.e javac Welcome.java If compilation errors Bytecode Run Byteode i.e java Welcome Result If runtime errors or incorrect result 08/13/14 Võ Phương Bình - ITFAC - DLU 21 Executing Applications On command line java classname... in the directory? Welcome.java~ chapter2 08/13/14 Java source files and class files for Chapter 2 chapter19 Java source files and class files for Chapter 19 Võ Phương Bình - ITFAC - DLU 24 Anatomy of a Java Program Comments Package Reserved words Modifiers Statements Blocks Classes Methods The main method Input processing 08/13/14 Võ Phương Bình - ITFAC - DLU 25 Comments Similar... main(String[] args) { // Statements; } 08/13/14 Võ Phương Bình - ITFAC - DLU 33 Displaying Text in a Message Dialog Box You can use the showMessageDialog method in the JOptionPane class JOptionPane is one of the many predefined classes in the Java system 08/13/14 Võ Phương Bình - ITFAC - DLU 34 The showMessageDialog Method JOptionPane.showMessageDialog(null, "Welcome to Java!", "Example 1.2", JOptionPane.INFORMATION_MESSAGE); . Chapter 5: Arrays Part I: Fundamentals of Programming 08/13/14 Võ Phương Bình - ITFAC - DLU 2 Chapter 1: Introduction to Java What Is Java? Getting Started With Java Programming Create, Compile. Java? History Applications of Java Compare to C/C++/C# Characteristics of Java 08/13/14 Võ Phương Bình - ITFAC - DLU 4 History James Gosling and Sun Microsystems (1983-1984) Oak In a project of electric. dynamic 08/13/14 Võ Phương Bình - ITFAC - DLU 19 Getting Started with Java Programming A Simple Java Application Compiling Programs Executing Applications 08/13/14 Võ Phương Bình - ITFAC