1 / 19

CSCI 224

CSCI 224. Introduction to Java Programming. Course Objectives. Learn the Java programming language: Syntax, Idioms Patterns, Styles Become comfortable with OOP Learning to think in objects Learn the essentials of the Java class library

Download Presentation

CSCI 224

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. CSCI 224 Introduction to Java Programming

  2. Course Objectives • Learn the Java programming language: • Syntax, Idioms • Patterns, Styles • Become comfortable with OOP • Learning to think in objects • Learn the essentials of the Java class library • And how to learn about other parts when you need them

  3. Writing Code • It is not enough to write code that works. • It is important to write code that is also • Legible, Maintainable, Reusable, Fast and Efficient

  4. Java • Sun defines Java as a: • “…simple, object-oriented, network savvy, interpreted, robust, secure, architecture-neutral, portable, high-performance, multi-threaded, dynamic language.”

  5. What is Java? • History of Java • First started in 1990 as Sun’s Green project • Digitally controlled consumer devices identified as trend • Trend did not grow as expected • 1994 – WWW popularity • Netscape packaged Java within browser • - MS Explorer followed suit • Success ultimately depended on e-commerce

  6. What is Java • Java is a high level,third generation programming language • Compared to other languages it is most similar to C and shares much of the syntax • Unlike C++ Java is not a superset of C and substantial amounts of C code would need to be reworked to become a Java program

  7. Java is : • A Platform • Simple • Object-Oriented • Platform independent • Safe • High Performance • Multi-Threaded • Garbage Collected

  8. Platform • Three elements to Java • The programing language • The compiler • The Java interpreter • The Java compiler creates byte code and not code native to particular platform. The result is that the JVM the runtime machine interprets this code on the fly and translates it to the machine.

  9. Simple • Java is designed to be easy to write. • Not a lot of special tricks to confuse beginners • Memory allocation and deallocation are handled automatically. • Syntax is straight forward in most situations.

  10. Object Oriented • The core concept of Java • Everything is an object. • Huge libraries of objects are available. • Learning to use the API is essential

  11. Platform independent • The Java byte code is never really executed on the host machine. • Each JRE / JVM does all the work of interfacing with the OS and machine. • Also eliminates having to deal with variations in platform architecture • Integer is always four bytes.

  12. Safe • Java was designed from the ground up to allow for execution across a network. • Applets – executed with set limitations on what they can do to within your system. Essentially they run in a sandbox.

  13. High Performance • The Java byte code compiles on the fly with speeds that rival the C++ compiler.

  14. Multi-Threaded • Java is inherently multi-threaded allowing a single program to execute different processes independently and continuously. • The is a cost to this for the programmer. Just as in C pointer arithmetic can be hard to debug, debugging threads is a challenge.

  15. Garbage Collection • There is no need to explicitely allocate or de-allocate memory in Java. • No need to write destructor methods. • The JRE handles the trash.

  16. Practical • What do you need to run Java. • JDK – Java developer's Kit. • JRE – Java Runtime Enviroment • SDK – Java Software Development Kit • IDEs • Several development tools exist. • The most basic thing you need is Notepad or any text editor to write the java source files. • Jbuilder, Sun's One Studio , JCreator, Forte and Eclipse are just a few.

  17. Development Tools • 1995 – First JDK released by Sun (1.0) • Very limited • JDK 1.1 released • Limited GUI creation • 1.2 released • Major change – Swing components • Java 2 SDK release 1.2 • Better known as Java 2 • Most current version: 1.5

  18. Development Tools • Java 2 Editions • Java 2 Platform, Standard Edition • Java 2 Platform, Enterprise Edition • Java 2 Platform, Micro Edition

  19. Java Programs • Applets • Java program running within client Web browser • Servlet • Java program running on a server • Can ‘cooperate’ with applet or application • Application • Standalone program

More Related