Tài liệu hạn chế xem trước, để xem đầy đủ mời bạn chọn Tải xuống
1
/ 30 trang
THÔNG TIN TÀI LIỆU
Thông tin cơ bản
Định dạng
Số trang
30
Dung lượng
313,5 KB
Nội dung
! ""#" Course Objectives (1/2) Upon completing the course, you will understand : • Java applications • Primitive data types • Java control ow • Methods • Object-oriented programming • Inheritance • Polymorphism • Core Java classes (Swing) • Graphics Course Objectives (2/2) $%&&' Write applications Develop a simple GUI interface Write interesting projects Establish a +rm foundation on Java concepts Learning Patterns • Lecturer(1.5 hours): theory with sample programs • Labs (1.5 hours) : Practice theory using Java programs • Workshops/seminars: discussion/reection Assessment Pattern • (!)*%+ ,,,, Course work 30% 2 Mini-tasks 10% Project 20% Note: You have to pass both coursework and exam in order to pass the module. Contact Information • %-% » Friday, 12:30-13:30, Bevan Building • Email x.gao@mdx.ac.uk • Learning Materials http://www.cs.mdx.ac.uk/staffpages/xiaohong/cmt4001 Introduction to Java .&/0 12304 • Getting Started With Java Programming • Compiling and Running a Java Application • Compiling and Running a Java Applet Example 1 Using TextPad 2. File New 3. File Save As Hello1.java 3. Tools Compile Java [...]... • Forte by Sun (www.javasoft.com) • IBM Visual Age for Java (RAD) (www.ibm.com) Getting Started with Java Programming • A Simple Java Application Compiling Programs Executing Applications • A Simple Java Applet Viewing Java Applets • Applications vs Applets A Simple Application Example: //This application program prints Welcome //to Java! public class Welcome { public static void main(String[] args)...4 Tools Run Java Application What Is Java? • History • Characteristics of Java History • James Gosling Oak • Java, May 20, 1995, Sun World • HotJava – The first Java-enabled Web browser Characteristics of Java • Java... program prints Welcome //to Java! public class Welcome { public static void main(String[] args) { System.out.println("Welcome to Java!"); } } Compiling Programs • On command line – javac file.java Executing Applications • On command line – java classname Bytecode Java Interpreter on Windows Java Interpreter on Linux Java Interpreter on Sun Solaris Example javac Welcome.java java Welcome output: A Simple... Viewing Java Applets Applet Viewer Utility appletviewer htmlfile.html Example: appletviewer WelcomeApplet.html Applications vs Applets • Similarities • Differences Security Restrictions on Applets • Applets are not allowed to read from, or write to, the file system of the computer viewing the applets • Applets . (1/2) Upon completing the course, you will understand : • Java applications • Primitive data types • Java control ow • Methods • Object-oriented programming • Inheritance • Polymorphism • Core Java classes. Introduction to Java .&/0 12304 • Getting Started With Java Programming • Compiling and Running a Java Application • Compiling and Running a Java Applet Example 1 Using TextPad 2 Started with Java Programming • 30 6 (!% • 30 ?30 • 0 A Simple Application (!'