Difference between C/C++ and Java

  • Many people believe that the next major area in which microprocessors will have a profound impact is in intelligent consumer electronic devices
  • Recognizing this, Sun Microsystems funded an internal corporate research project code-named Green in 1991
  • The project resulted in the development of a C and C++ based language which its creator, James Gosling, called Oak after an oak tree outside his window at Sun
  • It was discovered later that there already was a computer language called Oak
  • When a group of Sun people visited a local coffee place, the name Java was suggested and it sucks
  • But the green project ran into some difficulties. the market place for intelligent consumer electronic device was not developing as quickly as Sun had anticipated
  • Worse yet, a major contract for which Sun competed was awarded to another company
  • So the project was in danger of being canceled.by sheer good fortune, the World Wide Web exploded in popularity in 1993 and Sun people saw the immediate potential of using Java to create so-called dynamic content for Web pages
  • Sun formally announced Java at a trade show in May 1995.java generated immediate interest in the business community because of the phenomenal interest in the World Wide Web
  • Java now is used to create Web pages with dynamic and interactive content, to develop large-scale enterprise applications, to enhance the functionality of Web servers(the computer that provides the content we see in our Web browser ), to provide applications for consumer devices(such as cell phones, pagers, and personal digital assistants), and more.
  • In 1995, we were following the development of java by Sun Microsystems. In November 1995, we attended an Internet conference in Boston
  • A representative from Sun Microsystems gave a rousing presentation on Java
  • As the talk proceeded, it became clear to us that java would play a significant part in the development of interactive, multimedia Web pages. But we saw immediately a much greater potential for the language
  • We saw Java as a nice language for teaching first-year programming language students the essentials of graphics, images, animation, audio, video, database, networking, multi-threading, and collaborative computing.

How Java is different from C/C++

Although java was modeled after C and C++ languages, it differs from C and C++ in many ways.Java does not incorporate a number of features available in C and C++. For the benefit of C and C++ programmers, we point out here a few major differences between C/C++ and Java languages.

  • Whereas Java does not use sizeof and typedef Keyword but it is used in C/C++ programming language
  • Here C/C++ programming contains Structure and union but java does not contain both of them
  • It also defines type modifiers such as auto, extern, register, signed, and unsigned. here the java does not define the type of modifiers keywords
  • Like C++ and Java, both are object-oriented programming but the syntax of both are technically different
  • C++ uses the pointer for storing address while java does not use pointer
  • Here the C++ is platform-dependent and Java is platform-independent because C++ requires compiler for compilation of program whereas the java compilation can be done at any platform such as compiler and interpreter
  • C++ does not have built-in support for threads whereas Java support threads (Where thread is used for executing multiple tasks through a single program)
  • C++ uses the header file concept for including libraries whereas the java use import concept to include different classes
  • C++ use goto statement where java does not
  • C++ uses destructor which is automatically call on object destruction
  • Through external libraries, the C++ can use the thread functionality
  • C++ supports the call by value and reference but Java support call by value does not call by reference
  • C++ is interactive to hardware but Java is less interactive with hardware

Translate »