Survey
* Your assessment is very important for improving the work of artificial intelligence, which forms the content of this project
* Your assessment is very important for improving the work of artificial intelligence, which forms the content of this project
JavaIntro 1/2 Java History: Java was designed for writing programs for small computers embedded in consumer electronics appliances. The design choices reflect the expectation that the language would be used to implement small, distributed, and robust programs. Certain features happen to make Java the ideal language for building programs for use on the Internet: -- run on wide variety of hardware platforms -- can be loaded dynamically via a network -- provides features that facilitate robust behavior Additional nice features include: -- pure object-oriented language (everything is an object) -- can work on multiple tasks simultaneously -- automatically recycle memory (called garbage collection) To make Java programs portable, they are translated into byte code by a Java compiler. (Byte code is an intermediate language in the compiler phases.) Programs translated into byte code are machine independent (front-end). The byte code is executed by a byte code interpreter, called Java Virtual Machine (JVM) (back-end). So, any Java application will run on every machine for which a Java virtual machine has been implemented (called a hybrid compiler/interpreter). ___________ __________ | | | | source ---> | front end |---> intermediate --> | back end |---> machine program |___________| language |__________| code machine machine independent dependent When you run a java program, each class definition is fetched by your program only when it is needed. So, Java loads classes dynamically. Can be used with a network browser containing a JVM capable of loading classes dynamically via a LAN or the Internet. Java application loaded by the web browser are called applets, a little application. (Easy and cheap to distribute software -- no CDs, disks, no updates.) JavaIntro 2/2 Java is comprised of these parts: * Java programming language -- with which Java applications are written. * Java Virtual Machine (JVM) -- an interpreter that runs compiled Java code. * Java runtime environment -- a predefined set of classes present in every Java installation, called packages, with each package oriented about some functionality (such as graphics, input/output, networking). Characteristics of Java: * Portable: An application written in Java will run on any operating system that supports the JVM. "Write once, run anywhere" is the motto. * Versions: Java Java 1.1 had Java 1.2 has Java 1.3 has 1.0 had 212 classes in 8 packages. 504 classes in 23 packages. 1520 classes in 59 packages. updates and corrections. * Free for Windows, Linux, and Solaris operating systems. Downloadable Software Development Kit (SDK), also known as the Java Development Kit (JDK), from http://java.sun.com . * Security: the language and the runtime environment were designed with security in mind. One can download software over the network, run it, and be assured that the program will not transmit a virus, read or write files on the hard drive, or crash the system. Has extensive, configurable permissions for restricting or enabling applications. * Networking: Very easy to write network applications using Java (compared with C/C++). * Internationalized: Designed to be used by all languages. The character type is 16 bit unicode, which supports all human languages. Has extensive international formatting capabilities for time, dates, currency, numbers, etc. * Performance: Java is an interpreted language, so it will generally be slower than languages compiled directly into machine language (as with C/C++). But the speed of execution within the JVM often is nearly as good as compiled C.