Presentation is loading. Please wait.

Presentation is loading. Please wait.

Lecture.1: Getting Started With Java Jiang (Jen) ZHENG May 9 th, 2005.

Similar presentations


Presentation on theme: "Lecture.1: Getting Started With Java Jiang (Jen) ZHENG May 9 th, 2005."— Presentation transcript:

1 Lecture.1: Getting Started With Java Jiang (Jen) ZHENG May 9 th, 2005

2 CS401/COE401 Summer 2005.Department of Computer Science.University of Pittsburgh 2 Outline Survey Course Policies What is Java Why is Java Special The process of programming Plan of this course Getting started with Java Topics for next lecture

3 CS401/COE401 Summer 2005.Department of Computer Science.University of Pittsburgh 3 Survey

4 CS401/COE401 Summer 2005.Department of Computer Science.University of Pittsburgh 4 Course Policies Webpage: http://www.cs.pitt.edu/~jzheng/CS401http://www.cs.pitt.edu/~jzheng/CS401 Lecture: M/W 12:30-2:15p.m. SNSQ 5129 Lab: M 02:30-04:20p.m. SNSQ 6110 Instructor: Jiang (Jen) Zheng Email: jzheng@cs.pitt.edu Phone: 412-624-8846jzheng@cs.pitt.edu Office: SNSQ 6501 O/H: M/W 10:00-11:30a.m. Text Book: Java By Dissection (Pohl and McDowell)

5 CS401/COE401 Summer 2005.Department of Computer Science.University of Pittsburgh 5 Course Polices: Totally 9 labs and 22 lectures. One midterm (06/15) and one final (07/ 27) No class on May 30 th and July 4 th Three to fours quizzes on class. Around 5 programming assignments. Grading: Midterm25% Final25% Quiz15% Assignment35% Total100%

6 CS401/COE401 Summer 2005.Department of Computer Science.University of Pittsburgh 6 What is Java? Computer Science is the study of algorithms and machines. Algorithms: instructions for human beings Program: instructions for computer/machines. Java is A high-level, object-oriented, interpreted, third generation programming language.

7 CS401/COE401 Summer 2005.Department of Computer Science.University of Pittsburgh 7 Why is Java special? Let you write a special program called applet. What is the advantage of applet? Traditional computer programs have far too much access to your system Java severely restricted what an applet can do. A Java applet can not Write to your hard disk without your permission Write to arbitrary addresses in memory

8 CS401/COE401 Summer 2005.Department of Computer Science.University of Pittsburgh 8 Why is Java special? Java is Object-Oriented Simpler, easier to read programs More efficient reuse of code Faster to market More robust, error-free code What is Object-Oriented? The primary mode of execution is interaction of objects with each other.

9 CS401/COE401 Summer 2005.Department of Computer Science.University of Pittsburgh 9 Why is Java special? Java is Platform Independent: the same.class file can be execute on any platform as long as the interpreter, Java Runtime Environment (JRE), is installed there.

10 CS401/COE401 Summer 2005.Department of Computer Science.University of Pittsburgh 10 Why is Java special? Java is Garbage Collected You don’t need to explicitly allocate and reallocate memory in Java. By knowing Java, you can take other courses easily, like CS445, CS1501, etc

11 CS401/COE401 Summer 2005.Department of Computer Science.University of Pittsburgh 11 The process of programming Understand the problem well Design the solution (algorithm) Consider alternatives Implementation Documentation Debugging Testing

12 CS401/COE401 Summer 2005.Department of Computer Science.University of Pittsburgh 12 Very Useful Links for Java Programmer Java APIs: http://java.sun.com/j2se/1.4.1/docs/api http://java.sun.com/j2se/1.4.1/docs/api Java Tutorial: http://java.sun.com/docs/books/tutorial/ http://java.sun.com/docs/books/tutorial/ javaPlace.net: http://www.sw-bc.com/javaplace http://www.sw-bc.com/javaplace

13 CS401/COE401 Summer 2005.Department of Computer Science.University of Pittsburgh 13 Plan of this course Plan to Cover Chapter 1-12. Chapter 1-5: To learn the basics of Java language from Java implementation point of view Concept point of view Chapter 6-7: To learn the principals of Object- Oriented programming and to learn to program effectively in an Object-Oriented way.

14 CS401/COE401 Summer 2005.Department of Computer Science.University of Pittsburgh 14 Plan of this course Chapter 8-9:Graphical User Interfaces (GUI) and applet Chapter 10: Reading and Writing Files Chapter 11: Exceptions Handling & Chapter 12: Dynamic Data Structures

15 CS401/COE401 Summer 2005.Department of Computer Science.University of Pittsburgh 15 Getting Started With Java (Lab1) To Write your first program, what you need: The Java 2 Platform, Standard Edition. SDK, Software Development Kit. A text editor pico emacs vi Some Integrated Development Environment (IDE). For example, BlueJ, JBuilder, Visio Studio, etc

16 CS401/COE401 Summer 2005.Department of Computer Science.University of Pittsburgh 16 First Application: Hello World Three steps for develop a Java Application Create a Java source file. Compile the source file into a bytecode file. Run the program contained in the bytecode file.

17 CS401/COE401 Summer 2005.Department of Computer Science.University of Pittsburgh 17 First Application: Hello World

18 CS401/COE401 Summer 2005.Department of Computer Science.University of Pittsburgh 18 Create The Source Code Change to your home directory cd Make a subdirectory for your program mkdir CS401 Change your current directory to this directory cd CS401 Start a text editor pico HelloWorldApp.java Type in the following word class HelloWorldApp { public static void main(String[] args) { System.out.println(“Hello World!”); } } Save the file by typing Ctrl-O

19 CS401/COE401 Summer 2005.Department of Computer Science.University of Pittsburgh 19 Compile and Run To compile this application: javac HelloWorldApp.java To Run this application java HelloWorldApp

20 CS401/COE401 Summer 2005.Department of Computer Science.University of Pittsburgh 20 First Applet: Hello World Save the two files: HelloWorld.java & Hello.htm To Compile: javac HelloWorld.java To run: appletviewer Hello.htm

21 CS401/COE401 Summer 2005.Department of Computer Science.University of Pittsburgh 21 Topics for next lecture Reading Assignment: Chapter 2.3-2.14 You don’t need to know the details but you should know what are those when I talk about it.


Download ppt "Lecture.1: Getting Started With Java Jiang (Jen) ZHENG May 9 th, 2005."

Similar presentations


Ads by Google