490 likes | 609 Views
CSci 1130 Intro to Computer Programming in Java. Instructor Tatyana Volk. Most experts who follow Web development think that Java is the most significant thing that has been developed for the Web.
E N D
CSci 1130 Intro to Computer Programming in Java Instructor Tatyana Volk
Most experts who follow Web development think that Java is the most significant thing that has been developed for the Web.
“Java may be overhyped, but it also may be as significant to the computer world as television was to broadcasting.”- U.S.News and World Report
Developers can build a variety of applications using Java • spreadsheets • word processors • accounting applications • asset management • databases • human resources • sales
Duke • The first applet -- Duke waving back at his parents over the Internet -- was born.
Interesting Applets from Java Tutorial: • http://www.javasoft.com/applets/index.html
Java includes: • Object-oriented features • Platform independence (truly portable across different operating systems) • Multithreading (different processes are executed at the same time) • Garbage collection (automatic memory management) • Networking and security features • Internet –Web development features
Basics of a Typical Java Environment. • Java systems generally consist of several parts: • an environment, • the language, the Java Applications Programming Interface (API) • class libraries
Java programs go through 5 phases to be executed: • edit • compile • load • verify • execute
Examples of such Java systems: • Java Workshop • Visual J++ (Microsoft) • Symantec Café • Visual Age (IBM) • JBuilder(Borland)
The Java compiler translates the Java program into bytecodes -- the language understood by the Java interpreter. The file called with the extension .class is created.
The Java compiler translates Java sourse code into Java bytecode, which is a representation of the program in a low-level form similar to machine language code. The Java interpreter reads Java bytecode and executes it on a specific machine.
Loading The program must be placed in memory before it will be executed. This is done by the class loader that takes the Hello.class file containing bytecodes and transfers it into memory. The class file can be loaded from a disk on your system or over the Internet.
When the browser sees the applet in HTML document, the browser launches the Java class loader to load the applet. Once the applet is loaded, the Java interpreter in the browser begins executing the applet.
Before the bytecodes in an applet are executed by the Java interpreter, they are veryfied by the bytecode veryfier. (to ensure that files loaded from the Internet do not violate Java security restrictions - not to damage your files and system).
Finally, the computer interprets the program, one bytecode at a time.