The Java And Javascript Languages Computer Science Essay

Published: Last Edited:

This essay has been submitted by a student. This is not an example of the work written by our professional essay writers.

An easy and simple scripting language named as Live Script was initially created by Netscape. This language was in fact a proprietary addition to the already existing HTML. Netscape proved to be fast enough to leap on to the Java bandwagon, when Java, at that time the new language developed by the famous "Sun" had become unpredictably famous and popular. The company had re-christened their scripting language and called it "JavaScript". Excluding the four of the first letters, the two have nothing much in common.

The two languages that I mentioned are entirely different languages having very few similarities. Getting into the depth, the difference is in the purpose as well as the architecture which in turn means that the applications that run on them are also not similar. I would like to mention here that both the languages we are talking about are object-oriented. Java is programming language where as JavaScript is a scripting language, as the name also depicts, thus cannot be categorized as a proper programming language. Due to the similarity in their names, very often do people, which include some programmers also, confuse and mix Java with JavaScript. Actually java is a completely furnished programming language as compared to JavaScript which is just a portion of a web page. Using Java, programmers can develop small applications, known as applets that are downloaded when we request for a web page to load. On the contrary JavaScript is not a separate program. It is incorporated and forms a part of the web page itself. It has some minor but important functions like allowing the developers and designers to carry out actions like opening a new window by using the current code being used to generate a web page. Nevertheless, both of them improve the web pages adding additional features which won't have been likely using HTML. They both also have a fair security level incorporated in them to protect against malevolent external objects and use.

As I mentioned earlier, Java is one of the most renowned Object Oriented Programming (OOP) language. The creators generally known as Sun are named actually as James Gosling of Sun Microsystems. It was initially intended for being used on digital mobile equipment and devices which for example are cell phones. But, when they released Java 1.0 in 1996, the major focal point had moved to its utilization with the Internet. It offered much more interactivity for the users by allowing the developers to create animated Pages. Java is famous for its flexibility and lets the programmer create applications which are possible to download, from the internet or a network and then install and use it very safely on most of the Operating systems. It runs on more or less all platforms, provides software mechanism as required, and also consists of built-in security features as I already mentioned. Java has been designed somewhat like C++, but it was done so, that the syntax is much easy to comprehend. Java's virtual machine, which is actually its base software component, permits it to run on most computer platforms. What the java virtual machine accomplishes is to take information from computer and translate it to a form which is interpretable by Java. It is a wonderful tool to produce standalone application. Applets when needed are programmed in a way to be downloaded as separate files to the web browser along with the HTML document, and offer a wide variety of extra features to the Web sites the user opens. The exhibited outcome of applets can be seen to be embedded inside the HTML page for example when we see a banner message scrolling on the sites which is common on Java based web sites. But one thing that needs to be considered here is that the Java code comes as a separate file and not embedded. Java needs to be translated to what we call the "machine language" prior to be running on Web. Essentially, what takes place is that once the programmer writes a program in java and ensures a check for errors, and then hands it to another computer program which modifies the text code into a lower level language. This language is set-up to be seen by the computer as a collection of programs with specific beginning points and end points. Not anything can be added or subtracted to it exclusive of making the program corrupt. Security is one feature that makes Java so popular. Security is known to be inherent in java. The language was intended in a way so that devious developers are not able to make applets which can enter users' computers revealing passwords and other personal things. Java only allows applets to function with the use of a sand box which forces applets to remain in the sandbox's boundary as a result inhibits hacking. This is unique in its safety to an extent that it is used a lot more compared to Microsoft's safety equipment known as Active X. It is built in collaboration between internet users and providers.

JavaScript was actually created by Brendan Eich and was enabled to be embedded into Web pages. It could process numbers and in addition alter the forms contents. JavaScript was first known as Mocha while being developed, then Livewire and finally Live Script. Its core script syntax strongly looked like it was in Java, so finally was given the name JavaScript when released. Its way of referencing forms and anchors as a child of the object of that document, and the inputs also as child of its parent form, turned into being known as DOM level 0. Very soon after this, Netscape agreed their JavaScript to the European Computer Manufacturers Association (ECMA) for standardizing. ECMA in turn created a script standard, which personified JavaScript core syntax. Still, it did not state all aspects of the DOM level 0. With the release of Netscape 3 afterwards which was in the same year, they had developed JavaScript 1.1. This had the ability to change the position of images, introducing Web sites being made by the use of this feature and it became a famous Web page effects. It was actually replacing images when cursor came to it. These images were in addition referenced as children of object of the document. Consequently, the DOM level 0 was accomplished. JavaScript can be called a kind of programming language used to create web pages which are much more interactive for the user. It is flexible enough to run on host computer without continued downloads from the site. Java Script, as I mentioned earlier is also included in the category of object oriented programming languages. Method acting can be used in it as well. Some functions work for the entire objects range and other for some. It is comparatively a small scale language not allowing the creation of applets. Today, JavaScript is a feature of HTML documents. It can also offer various levels of interactivity and which is of course much more than the usual HTML pages without requiring any server-based CGI program or software.

It is significant to comprehend that a Java-enabled browser is not by design a JavaScript-enabled browser: the two expertise's need completely separate interpreters for the languages to be handled. Beginning with Netscape Navigator 3.0, the authors of HTML were capable of using JavaScript for linking HTML form elements with the Java applets. They also linked Java applets to each other and this technology is known as Live Connect (tm). Somewhat competing with one another, the two, Java and JavaScript seem to be powerful as a combination. So far, Java platform has fascinated above 6.5 million developers and programmers. It is commonly a use in each major industry sector, devices, computers, and also within networks. Java's adaptability, competence, platform portability, and safety make it perfect for network computing. Laptops, datacenters, game, supercomputers, mobiles, to Internet, it is seen everywhere in action. Also, Java controls more than 4.5 billion equipment, like:

850+ million PCs

2.1 billion handheld devices (source: Ovum)

3.5 billion smart cards

Set-top boxes, printers, Web cams, games, medical devices, parking payment stations, and the list go on.

Java has been experienced, developed, comprehended, and established by a devoted group of people. And figuring plus 6.5 million developers, it is the most used. With its flexibility, effectiveness, and portability, it is an asset for the developers and enables them to:

Write software on one platform and use it on other.

produce programs running inside Web browsers

Build up server-side applications for online forums, and also to process HTML forms etc.

unite applications using Java creating greatly customized applications

Write commanding and well-organized applications for cellular devices, remote processors, consumer products to make them economical, and basically any digital equipment.

Java consists of three platforms: Standard Edition (SE), Enterprise Edition (EE), and Micro Edition (ME). Each explain the grouping of a version of the language, including set of standard libraries, and also virtual machine. EE is a parent of SE. Any EE application can suppose SE libraries already exist. Sometime, Java source requires becoming platform-native code which can be executed. This normally requires a process in 2 steps: the developer assembles his own source to what is called Java byte code. Then Java Virtual Machine is used to convert this to subject code which will then be run on a host platform. This last step initially was executed by interpretation-it was done by converting each JVM instruction to more native and familiar instructions. Shortly, just-in-time (JIT) compilers transformed the Java programs from JVM byte code to native code. This happened when the program began. Currently, exist multiple approaches for this. Hotspot compilers also by Sun, initialize by inferring code and profiling it within the runtime. They also compile and optimize portions found to be critical to the operation of the program. "Mixed Mode Interpreter" work the same way and were given by IBM's JVMs. These moves evade initial performance, but ensure the performance pulls in over time because there is an optimization of code sections a little later. Java can be enabled in different ways. When Microsoft Explorer is used it can be done by selecting from the Tools menu the Internet Options tab and then selecting the Security tab and moving to Custom Level option, scrolling down to Microsoft VM and selecting a security level. Then press Enter. When using Microsoft Explorer 3.0 one needs to go a bit differently by choosing from View menu the select Option. Then, selecting the Security option and making sure that the Enable Java Programs option is ticked. ActiveX Scripts should also have been run by checking its box as well. Click OK. With Mozilla 1.X you need to go to the Edit menu and there look for Preferences tab. Choose Advanced category option and make sure that Enable Java option has also been selected and made active here.

Microsoft had included its own edition of JavaScript to Internet Explorer called JScript. Unluckily, the two were not the same, and thus Netscape tried to put things right by giving over JavaScript to ECMA which is a Switzerland-based standards organization. This resulted in 3 editions of JavaScript based languages. They were JavaScript, working mainly with Netscape's browsers, JScript, working with Internet Explorer, and the third one ECMAScript, which had no specific compatible browser. Netscape and Microsoft have agreed upon matching the upcoming versions with the present ECMAScript standards. This should result in convergence. Nonetheless, as the common features are present and thus compatibility is not really major issue except you try to use JavaScript with DHTML. Nowadays JavaScript can be used with Document Object Model (DOM) creating commanding web applications similar to Gmail. Gmail enables user to browse through email with no constant waiting for the web server. JavaScript is at the present capable of doing numerous jobs that previously needed Java or Flash. JavaScript is rising in reputation owing to its easy learning curve comparative to the powers it gives. Nonprogrammers can put in a slight of interactivity to web pages exclusive of buying an IDE or having difficulties compiling a program. There are plentiful Web sites which containing scripts accessible for taking, and Netscape has reasonably entire documentation made available to public. Certainly, the useful capability to observe the source of Web pages is always there. JavaScript is the main admired scripting language owing to its cross-platform and cross-browser hold, even though VBScript is from time to time used on intranets while the scripter identifies that everybody accessing the page is using Windows platform. JavaScript attempts to implement the commands inside the <SCRIPT> tag when no LANGUAGE attribute is available, or where LANGUAGE attribute has set to JavaScript; additionally, the LANGUAGE attribute as well can be used to differentiate among a variety of versions of JavaScript. There are 3 ways that JavaScript may be used in HTML files. Putting it inside <SCRIPT> tags in the <HEAD> tag (header scripts), inside <SCRIPT> tags in the <BODY> tag (body scripts), or called straight when certain actions happen. One of the major uses of JavaScript is rolling over image. This is a method which needs small programming knowledge, but can to a great extent improve the excitement of visiting a site. an additional admired use of JavaScript is form validation, which informs user if the form that has been submitted is applicable with no overhead of linking to Web server. This method gives user the feeling of quick Web access, when he did not access a server in any way. JavaScript is increasing in fame, owing to numerous features, together with its simplicity of learning, the increasing share of JavaScript-enabled browsers, and huge resources accessible to beginners. With Dynamic HTML, JavaScript will be further significant and more widespread soon. The current JavaScript security form is supported upon Java. Scripts that are downloaded are run by default inside a controlled "sandbox" environment so as to separate them from the other operating systems. Scripts are allowed right of entry only to data in the existing document or directly related documents (normally from the same site). No access is given to local file system for the purpose and the memory of further programs in action, or the operating system's networking layer. control of this kind is intended to avoid faulty or malicious scripts from causing disorder in the user's environment. The actuality of the circumstances, however, is that frequently scripts are not controlled as tidily as one would expect. There are many ways that a script might use control further than what you may anticipate, together with design or maybe accidently. The primary principle of browsers' security models is that there is no motive to have faith in at random encountered code for example which is found on Web pages, so JavaScript ought to be executed whatsoever. There are exceptions of some types of code, for example coming from a trusted web site. Such code is permitted comprehensive abilities, occasionally with the approval of the consumer but frequently without requiring explicit permission. Additionally, scripts can have access to some privileged information too and in further browser windows when pages are from associated domains. The most important JavaScript security plan is the same-origin policy. The same origin policy avoids scripts being used from one Web site by using the get or set functions. This strategy puts a stop to unfriendly code from another site starting to "taking over" or influencing documents from the other. Lacking this, JavaScript from a hostile website can perform any unwanted action for example snoop key presses, although you're logging to a website within another window, wait for you to go off to your online banking website and put in false transactions, whip login cookies as of further domains etc. There are various ways with which you can turn on and allow javascript. Whilst using Internet Explorer looks for "Internet Options" tab within menu of browser. Choose the "Security" tab. making sure that the "Internet" icon there is already highlighted. Click the "Custom Level" button to view the security options. Look for within the menu for "Active scripting" choice. Making sure "Enable" is chosen. Click "OK" and you are done with. Now you need to close the window and refresh the page requiring JavaScript. In the same way when using Netscape for Windows look for the "Preferences" in the menu, it is possibly located in the Edit menu. Selecting the "Advanced" arrow in the list on left; make sure the checkbox next to "Enable JavaScript" is accepted with a tick. Click "OK". Shut the window now and press "Reload" to load the page again requiring JavaScript. When using Safari for Macintosh, select the "Preferences" option located within the "Safari" menu. Chose "Security" button in top row of preferences and press it. Under the "Web Content:" group, enable or tick the "Enable JavaScript" box by checking it. Close the window and Reload the browser to refresh the page needing JavaScript. Now, when using Internet Explorer for Macintosh, you need to find out "Preferences" option within the menu bar of browser. Select the "Web Content" button which is available there in the list which is located on the left side of the window. Look for the "Active Content" area there and confirm that the checkbox next to "Enable scripting" is also ticked or checked. Then finally click the "OK". Shut this window and "Refresh" the page where you need to activate JavaScript. And when doing Netscape for Macintosh locates the "Preferences" choice in the menu of web browser which will be perhaps positioned in the menu of Edit tab. choose the "Advanced" bullet in this available list on the side of the window and select it. Making certain that the checkbox after the "Enable JavaScript" is checked. Click the "OK" button. Shut this window and then press the "Reload" to refresh and load the JavaScript.

Nevertheless to distinguish among two very improved programs there are some likeness and disparity which should be glanced at to appreciate what these two in fact are.


Capabilities of both of them can be used to boost the abilities of the Web pages.

Both can run and perform well on the host machines which mean that the device where the browser is running may not necessarily be a server where the page came from. This is in contrast to "CGI programs" - programs which run on the server and use the CGI to communicate with the client. Java can also be used to write CGI programs, and as better Java server packages become available, this use is becoming more popular.

Because both of them can run on the client, they can be of use instead of some CGI programs to decrease load on servers.

Both the languages can be easily misused or what we might call overused by putting irritating scrolling texts, very long and annoying loop of animations. In effect, abuse, i.e. misusing or overusing Java and JavaScript for such things has many a times given a bad reputation to both the languages. Also, a lot of people are of the view that these are the only ways java and javascript can be used and no other important or major uses exist which is a very wrong perception.

Both contain a fair level of security which has been built into them to protect against malevolent use. We should realize that none of the computer systems are ever found to be completely secure and safe except if they are locked and not put to use or at least no external connection is made to them, but the programmers of Java and JavaScript considered some security measures while doing their task. Still, nevertheless, Java is surely much more secure in comparison to JavaScript - The differences now we will discuss as follows here:


JavaScript is developed particularly by Netscape and Sun to improve abilities of the Web pages on the internet.

On the contrary, Java, is as it is thought to be is a general purpose programming language used all over the world. One of the important uses of java is also for the creation of the Web pages, but obviously it is used for many other major applications other than the internet these days and is very popular for its flexibility of platform.

Whereas coming to JavaScript it is purely a "scripting language", which surely means that the program using it for example, Netscape will interpret precisely what is written to be done or programmed.

On the contrary, Java is not at all inferred straight away. Unlike javascript, it is a must to compile a program written in java first, and that will then be the information which browser would be able to read. Not like the conventional compilers, where source code was transformed to a native machine code, here, Java compiler in intelligent enough to generate a transitional or midway "bytecode" and this being not dependent on any of the machine being used. An interpreter is created and embedded into the browser which runs this code. Strictly, this is known as the Java Virtual Machine or the JVM which we commonly know now days.

Whatever is written in JavaScript is what we normally call "JavaScript scripts"; the pieces of code we write in Java and especially for the web pages are known as "Java applets". There is c common mistake which is made by developers calling "JavaScript applet" or a "Java script". They both are considered wrong.

JavaScript source can be easily seen by anyone. All you need to do is to right click in the browser and press "View page source". The code will be displayed without any restriction of authorization by anyone e.g. using Netscape's "View Source" tab. But on the other hand, Java source is concealed and cannot be seen by a normal user since it is only the compiled bytecode and not the original program itself, which the browser can use. As I said the browser can only use the compiled bytecode. This is not an assurance of security at all by the way, as there are Java dissemblers also available. But yes we can say that in comparison to HTML, at least it is better, where it is only a way of marking text and all. JavaScript is much easier to learn and also use practically, whereas Java is much more commanding but difficult to learn and program comparatively being a vast language.

JavaScript was actually made and programmed keeping in mind the Netscape's Navigator, and thus it has an excellent support for a kind of interface which is with the browser being used by a host.

Java is being an OOP language is strongly-typed and complex and thus proves to be a very powerful language. Also, it easily stands upright in comparison and competition to other available object-oriented languages for example C++. Quite of the syntax of java is also like to C++, but as we analyzed earlier also, Java is much easier to be trained with and use than C++.

JavaScript is a language which is loosely-typed and much simpler, easier and straightforward than Java. Comparing the complexity, it is of the same level that is of the basic.

Java was designed keeping in mind, security as one of the major issues and was given the highest priority. The security mechanism that has been incorporated in Java has been created in Java Virtual Machine which runs the Java programs and also the java applets.

JavaScript, on the contrary, and in comparison to java is not as much secure. Even though few efforts have been done to protect the users from malicious JavaScript scripts but loop holes in the security are exposed much more frequently in this rather than in Java.

Another key dissimilarity is the way in which the language is presented or visible to the end user. Java must be compiled into what we call a "machine language" earlier than it can be used on the Web for different purposes. Fundamentally what takes place is that subsequent to the programmer writing the program and checking it for errors, and handing it over to a different computer program which will change the text code to a smaller language for the systems interpretation.

Moreover, of all the similarities and differences there exist advantages and disadvantages also. Although both programming languages may turn out to be exceptionally effective, Java proposes and gives much more flexibility due to the fact that it does not have limits to the constraints that have been put forth by HTML document where it has been embedded. Java, though, is also a further challenging language. A fundamental knowledge of HTML programming is most likely adequate for creating a JavaScript program, but programming in Java normally necessitates some knowledge of working with C and C++ languages. Along with rewriting JavaScript programs, Java programs can be to a great extent more occupied affair. The latter just needs you to go to an HTML document and altering some code. With Java, on the other hand, programs should be in machine language and after that compiled to a type that the browser can comprehend. Redraft a Java program needs rewriting machine language code and after that it has then to be recompiled also to a legible and readable code. JavaScript's key advantage is that it can be comprehended by anyone. It is simpler, easier and more robust than Java as well due to the small size and scale. It permits for quick formation of Web page events. Several JavaScript instructions are also given a special name, Event Handlers: They can be embedded straight into the already existing HTML commands. JavaScript is more modest than Java can be considered. It tolerates more autonomy in the making of objects. Java is extremely inflexible and rigid requiring all the items to be denoted. JavaScript permits to call on an object that previously was present, for example the status bar or the browser maybe, and deal with only that part. JavaScript is associated with only Web pages where as Java is geared in the direction to where its need arises with time. Using JavaScript inappropriately may root out exclusive features to haphazardly emerge and that will occur at an incorrect time and location on a website being used by the user. Pictures could be in motion autonomously when they are not at all needed. Buttons can modify themselves independently and the worst, popup windows can come out anytime. So, it can wholly damage the visual appearance of a site. An additional difficulty is that if you desire to use JavaScript to generate popup windows but at the host end popup windows feature is disabled in the browser, the client will by no means even have a look at that information or characteristic. It is still wonderful to have JavaScript in use and albeit there may be a number of security risks, one should for all time keep in notice that there are at all times security risks with any alternative choice you may have, when creating a site.

But nevertheless, the relation between the two cannot be denied and to give an analogy they can be described as Java and JavaScript, corn and syrup. Comparing the two, initially, to get started with, JavaScript can be a bit easier than Java, because of its forgivingness regarding functions it can perform. On the other hand, this also might mean that it can serve to pick up a few dire habits, such as failing to notice the idea of data types. Finally, it comes down to what is needed to be accomplished initially. Whichever, doing tasks with browser to maneuver WebPages (JavaScript), or write programs which act and run like applications on hosts and servers. On the host, both languages allow developer for creation of dynamic web material except that the fundamental methods for doing so are very dissimilar. JavaScript/HTML is much further and extensively used in making client-side web content which includes composite and dynamic Commerce sites as well. But, Java's premature promise to become the main client-side web tool has washed out. With respect to gaming, both the languages hold vast potential to develop into famous Internet gaming languages. As far as Java is concerned, there are by now lots of games that have been created, but the main troubles are, slow download speed and small popularity for multiplayers. With JavaScript, the dilemma is poor game design and interface. A concluding and interesting viewpoint of the subject is JavaScript and its interaction with Java. Possibly they both have a good future in here. JavaScript can be used to collect data for Java, and can to a great extent assist web improvement or other appreciable applets. The closing consideration would be that Java and JavaScript are both up-and-coming technologies. Within the middle tier, Java has a commanding and dominant widely sustainable explanation in Java 2 Enterprise Edition.  It is held up by numerous vendors and broadly used in industry as being an appreciable platform to create dynamic WebPages. Also, its use for implementing business logic cannot be denied. Server-side JavaScript scripting has now faded and died out. JavaScript and Java actually have very slight in common, except an apparent resemblance in their syntax. In almost every aspect, these languages are not similar. JavaScript is a straightforward scripting language proposed to run within a browser where as Java is an influential general purpose language used to produce numerous applications. Experienced developers favor coding in Java because of its object-oriented basis. Skilled programmers might discover JavaScript's loose approach annoying while adding up dynamic potentials to an HTML page but normal programmers will be pleased with JavaScript's ease of quick learning and working. Both Java and JavaScript have their own advantages. It is frequently a fine thought to begin by learning and working with JavaScript because it focuses more towards the fundamentals. Once JavaScript is at hand, you can consider switching to Java. Learning JavaScript will not essentially assist you to learn Java, but going through them in this way is preferred. If you have earlier worked with C and C++, subsequently you can also jump straightaway learning java.

Work cited (Reference)

Burns, By Joe. "Java vs. JavaScript -" HTML Goodies. Web. 23 Apr. 2010. <>.

"Java vs. JavaScript." Danny Goodman FAQ. Web. 23 Apr. 2010. <>.

Http:// Web.

"Java Vs. Javascript 1." Joomla Resources, Articles and Extensions. Web. 23 Apr. 2010. <>.

"Java vs. Javascript: The Age-old Battle." Online Magazine and Writers' Network. Web. 23 Apr. 2010. <>.

"What Is Java - O'Reilly Media." The Independent Source for Enterprise Java -- Java Development, Open and Emerging Enterp. Web. 23 Apr. 2010. <>.

"JavaScript Security." Programming Help, Web Design Help, CSS Help - Dev Articles. Web. 23 Apr. 2010. <>.

"Java Vs. JavaScript." Java Articles,Tips,Tutorials - JavaBeat. Web. 23 Apr. 2010. <>.

"Java Vs Javascript - Essays - Getmydegree." Free Term Papers, Research Papers, Custom Essays, and Book Reports Web. 23 Apr. 2010. <>.

"BBC - Webwise - Ask Bruce - What Are Java and Javascript?" BBC - Homepage. Web. 23 Apr. 2010. <>.

1962, Proposed In. "JavaScript History." How To Create. Web. 23 Apr. 2010. <>.

Chapman, Stephen. "What Is Javascript." JavaScript Tutorials, Scripts, Answers and Much More JavaScript. Web. 23 Apr. 2010. <>.

"What Is JavaScript?" MacTech | The Journal of Apple Technology. Web. 23 Apr. 2010. <>.

"Learn about Java Technology." Java + You. Web. 23 Apr. 2010. <>.

Leahy, Paul. "What Is Java?" Learn Java - Tutorials, Tips, Help, and Resources for Learning Java. Web. 23 Apr. 2010. <>.

"How to Turn on Javascript." Botany and Plant Pathology, Purdue University. Web. 23 Apr. 2010. <>.