04-12-2012, 01:15 PM
Java Tutorial
Java Tutorial.ppt (Size: 146.5 KB / Downloads: 55)
Java - General
Java is:
platform independent programming language
similar to C++ in syntax
similar to Smalltalk in mental paradigm
Pros: also ubiquitous to net
Cons: interpreted, and still under development (moving target)
Java has some interesting features:
automatic type checking,
automatic garbage collection,
simplifies pointers; no directly accessible pointer to memory,
simplified network access,
multi-threading!
How it works…!
Java is independent only for one reason:
Only depends on the Java Virtual Machine (JVM),
code is compiled to bytecode, which is interpreted by the resident JVM,
JIT (just in time) compilers attempt to increase speed.
Java - Security
Pointer denial - reduces chances of virulent programs corrupting host,
Applets even more restricted -
May not
run local executables,
Read or write to local file system,
Communicate with any server other than the originating server.
Object-Oriented
Java supports OOD
Polymorphism
Inheritance
Encapsulation
Java programs contain nothing but definitions and instantiations of classes
Everything is encapsulated in a class!
Java Advantages
Portable - Write Once, Run Anywhere
Security has been well thought through
Robust memory management
Designed for network programming
Multi-threaded (multiple simultaneous tasks)
Dynamic & extensible (loads of libraries)
Classes stored in separate files
Loaded only when needed
Initialisation
If no value is assigned prior to use, then the compiler will give an error
Java sets primitive variables to zero or false in the case of a boolean variable
All object references are initially set to null
An array of anything is an object
Set to null on declaration
Elements to zero false or null on creation