Thursday 20 June 2013

JAVA VS C++

  • C++ was designed for systems and applications programming
  • It is Write Once Compile Anywhere ( WOCA )
  • It Allows procedural programmingfunctional programmingobject-oriented programminggeneric programming, and template metaprogramming
  • It Runs as native executable machine code for the target instruction sets
  • It has multiple binary compatibility standards 
  • Pointers, references, and pass-by-value are supported for all types
  • Supports Single and Multiple inheritance of classes, including virtual inheritance
  • Java is a general-purpose, class-based, object-oriented computer programming language that is specifically designed to have as few implementation dependencies as possible
  • It is Write Once Run Anywhere / Everywhere ( WORA / WORE )
  • It strongly encourages exclusive use of the object-oriented programming paradigm. It also includes support for generic programming and creation of scripting languages
  • Runs in a virtual machine
  • It allows metaprogramming and dynamic code generation at runtime
  • It has a single, OS- and compiler-independent binary compatibility standard
  • All types (primitive and reference ) are always passed by value
  • It supports single inheritance of classes, and supports multiple inheritance through the Interfaces


Execution time for different Environment for Pentium PC ( Windows 95 )
Version
Execution Environment
Execution Time
Java array
Classic VM, JDK-1.2.2-001
81s

HotSpot VM 1.0.1 / Client VM 1.3beta-O
58s / 58s
Java Vector
HotSpot VM 1.0.1 / Client VM 1.3beta-O
216s / 215s
Java ArrayList
Client VM 1.3beta-O
166s
C++ pointer
MS Visual C++ 6.0
44s

Cygwin B20.1, egcs-2.91.57
19s
C++ object
MS Visual C++ 6.0
11s

Cygwin B20.1, egcs-2.91.57
16s
C++ vector
Cygwin B20.1, egcs-2.91.57
15s
C++ STL
Cygwin B20.1, egcs-2.91.57
11s

0 comments: