Paper
DIFFERENCES BETWEEN JAVA AND C++1 INTRODUCTION Since its release in 1995, Java has been hyped in many places, including computer magazines, broadcast news, and the Internet, as the solution to all problems in the application development community. As it has only been around for approximately 4 years now, it is still emerging into the programming language market. The main area where Java has had a large impact had been on the Internet. It is widely maintained that “Java is definitely the best tool so far for writing Internet applets.” (relisoft/java/c_java.html) Testimony to this statement are the numerous sites on the WWW that currently use java applets.Apart from being able to create “cute” Internet applets, as yet Java has struggled to break into the area of application development. When compared to a language such as C++, java has some large advantages but also some disadvantages. In this paper I plan to discuss the differences between these languages and the merits of each.2 ADVANTAGES OF JAVA One of the attractions of Java as a programming language is that is is a purely object oriented language. This allows programmers to design reusable components easily, which can reduce development time. “You can churn out Java four or five times faster than C++” (mcmillan/JavaVs.htm) Another factor that can help reduce development time is its relatively simple syntax. It’s very similar to C++, making it very easy for an experienced C++ programmer to learn Java. Also it’s automatic memory management, which includes a garbage collector, negates the need to keep track of pointers or delete objects. This makes it much simpler to write and understand than C++. Another advantage Java has over other languages is its portability. When a Java program is compiled, it is not compiled into native machine code, instead it is compiled into byte code which can be interpreted by a Java Virtual Machine running on the host computer. Once a specific computer architecture has a Virtual Machine designed for it, the computer can execute any Java program that has been compiled into byte code. This portability becomes evident in web based applications. Web developers can write applications in Java, compile them once, and run them on any machine that has a Java compatible web browser. Although Java’s portability gives it a clear advantage over other languages, this feature also creates one of Java’s biggest disadvantages. 3 DISADVANTAGES OF JAVA Although Java’s ability for producing portable, architecturally neutral code is desirable, the method used to create this code is inefficient. Unlike natively compiled code, an interpreter must first translate the Java binary code into the equivalent microprocessor instruction. Obviously, this translation takes some amount of time and, no matter how small a length of time this is, it is slower than performing the same operation in machine code. On occasions where it is desirable for code to be as efficient as possible, Java’s automatic memory management may not be the best option. In languages such as C++ where memory management is done explicitly, it may be possible to speed up a program by altering the memory allocation and deletion, but this ability is taken away from us in Java. 4 DIFFERENCES BETWEEN JAVA AND C++ 4.1 Theoretical Differences4.1.1 Speed DifferencesThe difference in speed between C++ and Java is very important. Even with all of Java’s benefits, Java will not be widely excepted if it can not perform adequately. C++ has been widely adopted by developers and they will not be willing to change languages if the applications they develop with Java do not measure up to their personal and their clients standards. However, if the speed difference is negligible, developers may be willing to learn and program in Java because of the significant advantages the language offers. The introduction of just-in-time compilers for Java may have addressed some of these problems. “Just-in-time compilers have brought Java performance virtually neck-and-neck with C++” (ncworldmag/ncworld/ncw-01-1998/ncw-01-jperf.html).
4.1.2 Language Differences 1. In Java, everything is a class. There are no stand-alone functions. Even main() is a member function!2. In Java, everything is a reference, so the programmer must make sure that memory is allocated properly (using new!), but does not explicitly de-allocate memory.3. In Java, all arrays and objects are passed-by-reference, so a method can change any object that is passed to it.4. Java has built-in graphics capabilities, while in C++ the graphics parts of an application are vendor-specific.5. Java can be used to write both stand-alone programs (applications) and programs that can be run over the Internet by a Browser (Applets). 4.2 Physical Differences 1 Java Has No Pointers – The referencing and dereferencing of objects is handled for you automatically by Java. Java does not allow you to manipulate pointers or memory addresses of any kind: 2 Java Has No Global Variables – In Java, every field and method is declared within a class and forms part of that class. The fields and methods of a class are known as the members of a class.3 Java Does Not Support Multiple Inheritance – C++ supports multiple inheritance of method implementations from more than one superclass at a time. The Java language designers chose to avoid the added complexity by using interfaces instead. Thus, a class in Java can only inherit method implementations from a single superclass, but it can inherit method declarations from any number of interfaces4 Java Does Not Allow Operator Overloading – C++ allows you to define operators that perform arbitrary operations on instances of your class. In effect, it allows to extend the syntax of the language. After much debate, the Java language designers decided to omit such operator overloading from the language.5 Java Includes the Use of Threads – Java allows multiple execution paths to be carried out virtually simultaneously, thus providing a way to handle concurrent operations. 5 CONCLUSION There is currently a large debate going on over whether Java is all that it is cracked up to be. Some say that Java is a wonder language that will eventually support it’s own platform and leave the Windows OS in the dust. There are others that say Java not nearly as good as everyone says it is, and besides some nifty web applets, Java is not very useful.These people should bear in mind that Java is relatively new, and not too many software developers have started using it. If Java can live up to it’s potential as a truly object oriented programming language, it could change the face of computing as we know it. C++, on the other hand, has been around for a little while and is currently very integrated into the computer community. Just about everyone agrees that C++ is useful and although it may not be the best object oriented programming language out there, it is certainly here to stay.6 REFERENCES 1. Java vs C++ Viewed 15 May 1999, cs.wisc.edu/ cs368-1/SECTION/NOTES/Java-vs-C++.html2. ME Inc. Java Vs the Others Viewed 14 May 1999, mcmillan-inc/JavaVs.htm3. The Battle of Languages Viewed 15 May 1999, relisoft/java/c_java.html4. Just In Time for Java vs. C++ Viewed 13 May 1999, ncworldmag/ncworld/ncw-01-1998/ncw-01-jperf.html5. Eckel, Bruce. (1998) Thinking in Java. Prentice Hall Inc.
Другие работы по теме:
Of Mice And Men Comparing The Movie
And The Book Essay, Research Paper The movie of Of Mice and Men had many differences while still giving the same message that the book was portrayed to have. One of the major differences was that Candy never came into the room when Lennie and Crooks were talking to each other. This was major because Crooks never found out that the plan was true about the little house.
Why Viewers Have Compassion For Frankenstein Essay
, Research Paper Because each person reacts to differences in different ways it is a difficult subject to explain. In my opinion the films “Frankenstein” and “Edward Scissorhands” both mirror how society as a whole reacts to differences.
Cyrano De Begerac Essay Research Paper Cyrano
Cyrano De Begerac Essay, Research Paper Cyrano De Begerac, the play and Roxanne the 80?s version of the play have a lot of differences between them. In this essay I chose to write about three of
Canadians And Americans Essay Research Paper Canadians
Canadians And Americans Essay, Research Paper Canadians and Americans There is much that has distinguished the Canadian experience as different from thatwhich has, and continues to, define the American experience. At first glance, superficiallyCanada and the United States share many aspects in common, for as one comedian oncestated “Canadians are just unarmed Americans with health care”, and for the most part,this is the common belief, as viewed by other nations in this world.
Canadians And Americans Two Different Societies Essay
, Research Paper Canadians and Americans There is much that has distinguished the Canadian experience as different from that which has, and continues to, define the American experience. At first glance, superficially
Jewish Essay Research Paper Beowulf EssayThere were
Jewish Essay, Research Paper Beowulf Essay There were many differences between Beowulf the play and 13th Warrior the movie. In the play Beowulf was depicted as a soul warrior who?s strength and ability was
Indonesia Essay Research Paper IndonesiaThis report will
Indonesia Essay, Research Paper Indonesia This report will be on the History in Brief of Indonesia, the Government of Indonesia, the island of Java, and the Geography of Indonesia. In early days, the region from India to Japan, including Indonesia, was known to the Europeans as the Indies. Chris Columbus was looking for a westward sea root from Europe to the Indies, when he arrived in America.
Westside Story Essay Research Paper Romeo
Westside Story Essay, Research Paper Romeo & Juliet and Westside Story The plays Romeo and Juliet and Westside Story have many similarities and differences. One major compare and contrast in the two,
Race In The Context Of Reading And
Writing Essay, Research Paper Race In the Context of Reading and Writing Hurston is saying in effect, I am colored but I am different from other members of my race in that I am not different from my race ( Race, Reading, and Difference 319).
Anthem Essay Research Paper In comparing the
Anthem Essay, Research Paper In comparing the collective society in Anthem by Ayn Rand, and the society that Prometheus envisions at the end of the book, there are many differences, and few similarities. The collective society is all about unity, and people living, breathing and doing everything together, while the way of life Prometheus dreams of and is hoping to create is free and not limited.
Differences Between Men And Wo Essay Research
Paper Differences between men and Women There are many traditional differences that we read about. Some major differences were stated about how the communication styles of men and women very. These differences can cause many problems in daily interaction between men and women. When people are communicating they expect that the other person will communicate in the same way.
Our Town By Thorton Wilder And The
Glass Menagerie By Tennessee Williams Essay, Research Paper When I compared Our Town by Thorton Wilder and The Glass Menagerie by Tennessee Williams I noticed a lot of differences and very few similarities. I noticed differences in the roles that the mothers played in each of the stories, and the impact that the father had on the family.
Athena Essay Research Paper Athena the goddess
Athena Essay, Research Paper Athena the goddess of wisdom, war, and useful arts, and the helper of heroes and inspiration for soldiers. She was the daughter of Zeus and the protector of cities and states. She was never easy to anger, she believed using wisdom was better to settle differences than fighting.
Slave Trades Essay Research Paper African slave
Slave Trades Essay, Research Paper African slave trade to the America and the European was much worse than slavery in Africa. In this essay ,I will show you the differences. Where were the slave trade took place. Slavery was mostly happing in North America in the carribean and in Europe.The ships full of slaves mostly come to Cuba.
Hamlet Kings Essay Research Paper There are
Hamlet Kings Essay, Research Paper There are many differences between the Kings Hamlet and Claudius with very few similarities. Perhaps the similarities stop at being the product of the same
The Differences Between Aegean And Egyptian Art
Essay, Research Paper The differences between Aegean and Egyptian Art The primary difference between Egyptian and Aegean art is that statutory and other forms of arts became more descriptive of the human form in the Aegean Art. The paintings of people stood on a flat base rather than in a naturalistic space.
Another Computer Essay Essay Research Paper The
Another Computer Essay Essay, Research Paper The Computer Underground. The beginning of the electronic communication revolution that started with the public use of telephones to the emergence
Circe Vs Calypso Essay Research Paper Although
Circe Vs Calypso Essay, Research Paper Although both Circe and Calypso from Homer s The Odyssey fulfill the archetypal theme of the witch who hinders the protagonist s return, they have several differences between them.
In A Groove Essay Research Paper The
In A Groove Essay, Research Paper The short story “In a Grove” by Ryunosuke Akutagawa was made into a movie called Rashomon. The movie and the short story share both similarities and differences.
Java Essay Research Paper Java is the
Java Essay, Research Paper Java is the substance whose aroma is awakening the Internet community. It is a new programming language developed by Sun Microsystems that has
Java Verses C Essay Research Paper Java
Java Verses C++ Essay, Research Paper Java vs. C++Since their inception, computers have played an increasingly important role in today s society. Advancements in technology have enabled computers to become faster and cheaper. Today, the majority of families own a home computer that is vastly more powerful than giant mainframes of years gone by.
Key Differences Which Separate Pope From Wordsworth
Essay, Research Paper Key Differences Which Separate Pope from Wordsworth In comparing excerpts from Pope’s “An Essay on Man” and Wordsworth’s “Prospectus”, I found many similarities and some key differences. Pope’s lean toward the more structured and confined, and Wordsworth’s lean towards the informal and original.
Dfferences In Pope
& Wordswort Essay, Research Paper Key Differences Which Separate Pope from Wordsworth In comparing excerpts from Pope s An Essay on Man and Wordsworth s Prospectus , I found many similarities and some key differences. Pope s lean toward the more structured and confined, and Wordsworth s lean towards the informal and original.
Wealth Essay Research Paper Dan NeffPeriod 43697WealthThere
Wealth Essay, Research Paper Dan Neff Period 4 3-6-97 Wealth There are differences between those who are born wealthy and those who earn money. Wealth, especially monetary wealth, means the person can meet all of their needs and wants with great luxury and still have money left to use, waste, save, or share.
Similarities And Differences Of Rome And Usa
Essay, Research Paper Similarities and Differences of Rome and USABy: Bob Smith There are many similarities and differences between Rome and the USA. A lot of the Romans and the Americans every day life were similar. The government and the way they were run were similar. The way that both countries were established is similar also.
Great Expectations Essay Research Paper Great ExpectationsWhat
Great Expectations Essay, Research Paper Great Expectations What are your expectations in life? Are yours similar to anyone else? In Great Expectations by Charles Dickens the main character Pip has many expectations. By reading this book I have found that Pip and I have many similar and different expectations in life.
Social Class Differences Essay Research Paper Social
Social Class Differences Essay, Research Paper Social Class Differences Peer Influences?researchers say some low-SES students become part of resistance culture, these kinds of kids see it as "selling out" or
Making A Web Page Essay Research Paper
Making a Web Page For my science project I chose to create a web (internet) page, dealing with science. This project consists of using a computer and a html editor to create a page that can be found on the internet. The next paragraph will explain how to make an internet page. The steps to making a web page to post on the internet, is very easy.
When Legends Die Essay Research Paper Response
When Legends Die Essay, Research Paper Response to WLD Movie and Novel When the Legends die was very similar in the novel and in the motion picture. There were some differences, but most remained the same.
Java Project Essay Research Paper Jennifer
Java Project Essay, Research Paper // Jennifer Farley // Java Term Project import java.awt.*; import java.applet.*; public class scroll extends java.applet.Applet implements Runnable {
Cats And Dogs Essay Research Paper Dogs
Cats And Dogs Essay, Research Paper Dogs and Cats When you compare cats and dogs their differences definitely out number their similarities. Dogs and cats are two of the most popular pets in the world but they are very different animals. Obviously, dogs and cats are two different types of species, but their differences stretch far beyond this simple fact.
Antigone Vs Creon Essay Research Paper Antigone
Antigone Vs. Creon Essay, Research Paper Antigone vs. Creon When you are about to examine the likes and differences between Antigone and Creon you wonder what the really do have in common, but in all actuality they are more alike then different.