Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6804441
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T19:27:58+00:00 2026-05-26T19:27:58+00:00

After reading the Java White Paper, I have a question on my mind and

  • 0

After reading the Java White Paper, I have a question on my mind and it might not be a very smart question but here it is anyway:
From what I gathered, Java attempted to improve an a number of fallacies associated with C++ such as redundancy, confusion with pointers, full-object orientation etc.,
If Java managed to overcome these issues, why would it be incorret to say that Java can replace C++.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-26T19:27:58+00:00Added an answer on May 26, 2026 at 7:27 pm

    There are many situations where C++ is a better option than Java. Comparison here.

    Specifically:

    In addition to running a compiled Java program, computers running Java
    applications generally must also run the Java Virtual Machine JVM,
    while compiled C++ programs can be run without external applications.
    Early versions of Java were significantly outperformed by statically
    compiled languages such as C++. This is because the program statements
    of these two closely related languages may compile to a few machine
    instructions with C++, while compiling into several byte codes
    involving several machine instructions each when interpreted by a JVM.

    Certain inefficiencies are inherent to the Java language itself,
    primarily:

    1. All objects are allocated on the heap. For functions using small objects this can result in performance degradation as stack
      allocation, in contrast, costs essentially zero. However, this
      advantage is obsoleted by modern JIT compilers utilising escape
      analysis or escape detection to allocate objects on the stack. Escape
      analysis was introduced in Oracle JDK 6.

    2. Methods are by-default virtual. This slightly increases memory usage by adding a single pointer to a virtual table per each object.
      Also, it induces a startup performance penalty, because a JIT compiler
      has to do additional optimization passes even for de-virtualization of
      small functions.

    3. A lot of casting required even using standard containers induces a performance penalty. However, most of these casts are statically
      eliminated by the JIT compiler, and the casts that remain in the code
      usually do not cost more than a single CPU cycle on modern processors,
      thanks to branch prediction.

    4. Array access must be safe. The compiler is required to put appropriate range checks in the code. Naive approach of guarding each
      array access with a range check is not efficient, so most JIT
      compilers generate range check instructions only if they cannot
      statically prove the array access is safe. Even if all runtime range
      checks cannot be statically elided, JIT compilers try to move them out
      of inner loops to make the performance degradation as low as possible.

    5. Lack of access to low level details does not allow the developer to better optimize the program where the compiler is unable to do
      so.[10]. Programmers can interface with the OS directly by providing
      code in C or C++ and calling that code from Java by means of JNI.

    Also as an iOS/Mac dev, and strong background in DSP, and lover of many open source C++ and Objective C libraries, I could go on and on as to why Java is not better…

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

After reading this question , I was reminded of when I was taught Java
After posting this question and reading that one I realized that it is very
After reading Evan's and Nilsson's books I am still not sure how to manage
After reading the answers to the question Calculate Code Metrics I installed the tool
After reading the Test-and-Set Wikipedia entry , I am still left with the question
Reading Java's ConcurrentLinkedQueue Docs , I wonder why it is not possible for the
After reading To ternary or not to ternary? and Is this a reasonable use
After reading a few questions on what Java data type to use for currency/money,
I have the .java, .class, .cpp, .h files: http://www.ibm.com/developerworks/java/tutorials/j-jni/section2.html After reading TotalFrickinRockstarFromMars's comment, I
I have a simple java program that runs fine in eclipse but cannot find

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.