Up Java Resources

C++ vs. Java

C++

Java

  • Multiple class declarations per file.
  •  Single (public) class declaration per file.
  • Scoping controlled by inclusion of header files.
  •  Scoping controlled by keywords.
  • No garbage collection.
  • Automatic garbage collection
  • No standard GUI or networking library
  • Standardized GUI and networking libraries.
  • No virtual machine overhead.
  • Virtual machine processing overhead.
  • Separate declaration and definitions files.
  • Single declaration+definitions files
  • Compiles to native machine code.
  • Compiles to machine-independent byte code.
  • Explicit linking step required.
  • Linking done automatically at run-time.
  • Cannot initialize class members in their declarations.
  • Can initialize class members in their declarations.