An Overview of Java

Reviews
Shared by: bloved
Stats
views:
98
rating:
not rated
reviews:
0
posted:
11/5/2008
language:
English
pages:
0
' $ An Overview of Java & overview-1 % ' $ Contents • What is Java • Major Java features • Java virtual machine • Java programming language • Java class libraries (API) • GUI Support in Java • Networking and Threads in Java & overview-2 % ' $ What is Java • A Sun Microsystem Development (James Gosling) • An effective OOP language • Run-time environment (Interpreter w. GC and threads) • Portable (architecture-neutral via Java Virtual Machine) • java, javac, class library, tools, documentation • Designed for easy Web/Internet applications • Widespread acceptance & overview-3 % ' $ Java Products From Sun Micro Systems and other companies: • SDK or JDK (Software Development Kit) – JVM, compiler, interpreter, JFC, JavaDoc, Jdb, AppletViewer ... • Java Plug-in for browsers to run applets • JavaBeans – reusable Java component API • Java IDEs – integrated development environments • JavaOS – compact os for running Java programs • Server side – Servelet, JSP, JDBC, Application Web server • Many, many other tools and applications. & overview-4 % ' $ Java Language Features • Platform independence • Totally Object-oriented, but simpler than C++ • Dynamic incremental loading and linking • Automatic GC • Multithreaded • Systematic class, package, and source file naming • GUI and graphics programming • Web and network applications support • Internationalization (programs in Unicode) & overview-5 % ' $ Java Virtual Machine • Compact JVM interprets bytecode, does GC • Written in C, has OS/platform layer • Uses threads • Has just-in-time compilation • JVM has simple instruction set • Bytecode register based, byte order independent • Easy to generate machine code & overview-6 % ' $ The Java Language • Easy to learn: similar to C++ • Packages and interfaces • Strings and arrays as objects • Classes as objects • No: – structs, unions, typedefs – operator overloading – pointer arithmetic or -> – preprocessor or header files – un-attached functions – implementation-dependent features & overview-7 % ' – inline, register, const, friend, or multiple base classes – need to free memory or recompile on different platforms $ & overview-8 % ' $ Java Primitive Data Types Primitive Type boolean char byte short int long float double Description true or false 16-bit Unicode character signed 8-bit integer signed 16-bit integer signed 32-bit integer signed 64-bit integer 32-bit floating point (IEEE 754-1985) 64-bit floating point (IEEE 754-1985) & overview-9 % ' $ A First Java Program /////// File: Average.java /////// public class Average { public static void main(String[] args) { int i = 11, j = 20; double a = (i + j)/2.0; System.out.println("i is " + i + " and j is " + j); System.out.println("Average is " + a); } } & overview-10 % ' $ Compile and Run • javac Average.java: produces Average.class • java Average: to run • Use CLASSPATH environment variable to locate class code • java returns exit code not main. neptune:{57}java Average i is 11 and j is 20 Average is 15.5 & overview-11 % ' $ Robustness • No implicit declarations • Automatic GC • Link-time type checks • No pointer manipulations • Array and string objects & overview-12 % ' $ Java Exceptions import java.io.*; class Lowercase { public static void main(String[] args) throws IOException { int i; char c; while ( (i = System.in.read()) != -1 ) { c = Character.toLowerCase( (char) i); System.out.print(c); } } } & overview-13 % ' $ Web Application & overview-14 % ' $ Web Application: applets • Java code can supply executable content in Web documents • Java-enabled Web browsers can execute such contents • The Sun Java-Plugin supports applets for popular browsers • The HTML tags • Simple applet tag is similar to the img tag • & overview-15 % ' $ Java Class Libraries • java.lang – core language support • java.io and javax.nio– I/O streams • java.net and java.rmi – networking and remote method invocation support • java.math – support for big numbers • java.awt and javax.swing – cross-platform windowing toolkits • java.text– support for international text strings, dates, and numbers. • java.util – generic containers and other utilities API documentation in HTML. & overview-16 % ' $ Java Supports GUI Programming JFC (Java Foundation Classes) supplies GUI components: • Buttons, Canvases • Checkboxes, Choices • Dialogs • Frames • Labels • Lists • Menus, Scrollbars • Text areas & overview-17 % ' $ Java Supports Networking The java.net package supplies networking tools: • URL object helps URL parsing, URL document reading (normal InputStream reading, via openStream method) • URLConnection object allows I/O to an HTTP-server. • Socket objects makes socket-based networking easier. In addition, RMI enables remote object invocation and servlets support web servers. & overview-18 % ' $ Threads in Java • Java uses and allows multi-threaded programs • Thread class and Runnable interface • Mutual Exclusion via synchronized methods • Synchronization via wait and notify & overview-19 % ' $ Java Documentation • Available for browsing on the Web or download to your own computer • Demos, tutorials, guides to topics • description of Java tools • Application Programming Interface (API) specification: 1. all packages 2. all classes, interfaces, and exceptions within a package 3. all member constructors, methods, and fields within a class & overview-20 %
Related docs
Java-and-UML
Views: 15  |  Downloads: 5
Java Basics
Views: 473  |  Downloads: 63
Java Technology Overview
Views: 22  |  Downloads: 2
Java Overview
Views: 2  |  Downloads: 0
03- Java- Intro+ Overview
Views: 16  |  Downloads: 2
Collections in Java
Views: 162  |  Downloads: 18
A History of Java
Views: 174  |  Downloads: 29
Java Tutorial
Views: 374  |  Downloads: 57
A Brief Introduction to Java
Views: 61  |  Downloads: 21
Computer Notes
Views: 26  |  Downloads: 5
premium docs
Other docs by bloved
You are Holy
Views: 258  |  Downloads: 2
de165
Views: 101  |  Downloads: 0
Why German is For You
Views: 565  |  Downloads: 20
The Fascinating World of Angel Investors
Views: 307  |  Downloads: 20
I Stand In Awe of You
Views: 406  |  Downloads: 2
dv110
Views: 213  |  Downloads: 3
dv110v
Views: 113  |  Downloads: 0
cr125
Views: 88  |  Downloads: 0
ch151
Views: 116  |  Downloads: 0
IPS Skeleton Outline
Views: 368  |  Downloads: 5
Reverse_Mergers_Creating_Rapid
Views: 373  |  Downloads: 14
Accounting Midterm Exam
Views: 1288  |  Downloads: 82
cr130
Views: 91  |  Downloads: 0
Baker v Allied Supermarket
Views: 214  |  Downloads: 0
app003
Views: 79  |  Downloads: 0