csci 1130 intro to computer programming in java

Post on 16-Mar-2016

78 Views

Category:

Documents

7 Downloads

Preview:

Click to see full reader

DESCRIPTION

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. - PowerPoint PPT Presentation

TRANSCRIPT

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

History of Java (author James Gosling)

Sun, 1994 -- Oak compileris written. Naughton andJonathan Payne built anOak-ready browser calledWebRunner.

Sun made the decision togive the language away,but not before renaming itJava.

With Java in the handsof the Internetcommunity at large, allthat was needed was away to run Java applets.

WebRunner wasrenamed the HotJavabrowser because of atrademark conflict.

Netscape began supportingJava in 1995.

Applications-traditionalstand-alone programs.

Developers can build a variety of applications using Java spreadsheets word processors accounting applications asset management databases human resources sales

Java programs that runon the Web are calledJava applets (short forlittle applications).

Applets are imbeddedinto Web page. Theyare supposed to live onWeb page, not to berun on their own.

DukeThe first applet --

Duke waving back at his parents over the Internet -- was born.

Java is commonlythought of as a way tomake Web pages cool -incorporating soundor video into Webpages.

Java applets aredifferent from ordinaryapplications in thatthey reside on thenetwork incentralized servers.

The network deliversthe applet to yoursystem when yourequest them.

For example, let's saythat you want to checkyour personal financialportfolio.

You'd dial in to yourfinancial institution anduse your Web browserto log into the bank'ssystem.

The portfolio data willbe shipped to you alongwith the applet neededto view it.

Let's assume that you'reconsidering movingyour money from oneaccount to another.

The system will alsosend you an applet thatwill allow you tochange the rate ofinterest and length ofinvestment to perform aseries of "what-if"scenarios.

From the corporations'point-of-view, Java willsimplify the creationand deployment ofapplications thus savingmoney.

Applications created inJava can be deployedwithout modification toany computingplatform, thus savingthe costs associatedwith developingsoftware for multipleplatforms.

Because theapplications are storedon centralized servers,there is no longer a needto have people insertdisks or ship CD's toupdate software.

Interesting Applets from Java Tutorial: http://www.javasoft.com/applets/index.html

All browsers are now Java-enabled.

That means you can scan throughdocuments stored around the world,and, at the click of a link , activate aJava program that will come acrossthe network and run on your owncomputer.

The key advantage ofbeing Java-enabled isthat instead of passivetext and images appearon your screen ,calculations andinteractions can takeplace as well.

When the applet isembedded into page, and apage is visited by someoneusing Java-enabledbrowser (Netscape,Explorer, Sun’s HotJava,Mosaic) , the applet isautomatically sent to theuser’s computer andactivated.

Java allows Webdevelopers to create andautomatically deliversworking programs, notjust files, to any computeron the network.

You can send info backto host site .

Another importantproperty of Java is thatit is platform-independent.(independent of type ofcomputer you are using)

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

Designs run from simple to sophisticated,and uses range from management ofbusiness-to-business transactions... toscientific applications for sharing andanalyzing data... to scores of fun anduseful applets created for personal andconsumer use.

Java applets are storedon a host site in such away that they can runon any computer thathas a Java-enabledbrowser.

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

•edit

•compile

•load

•verify

•execute

Java programs go through 5 phases to be executed:

Development Environments (IDE)

Edit-compile cyclerepeats.Software exists whichcombines compilingand editing and allowsto switch between themat the touch of a button

Examples of such Java systems:

Java WorkshopVisual J++ (Microsoft) Symantec CaféVisual Age (IBM)JBuilder(Borland)

IDE has an build-inenhanced editor forcreating user interfacesby designing them onthe screen

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.

LoadingThe 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.

Java is designed towork easily withinWWW of computersthrough commonlyavailable user-friendlysoftware calledbrowsers.

Java –enabled browsermeans that insidebrowser there is aprogram known asJava Virtual Machine(JVM) which can runJava for that particularcomputer.

The Java that comesover the Net is in astandard form knownas Bytecode.Your JVM canunderstand the appletand make it workproperly on yourcomputer.

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.

top related