Dismiss Notice
Join Physics Forums Today!
The friendliest, high quality science and math community on the planet! Everyone who loves science is here!

Why chose Java?

  1. Feb 5, 2012 #1
    The Android system is an OS by java for java, but why? What significant advantage does java posses over other languages? Is it because high-end hardware are so cheap and numerous, that no one need to think about the runtime efficiency anymore? Or because google wanna make money, and somehow consider java is somehow more developer-friendly comparing to others?
     
  2. jcsd
  3. Feb 5, 2012 #2

    phyzguy

    User Avatar
    Science Advisor

    The original reason for Java was to have a language where you could run the exact same code on any hardware. This is accomplished by having a 'virtual machine' on each hardware that runs the Java code. In answer to your question, there are many, many applications where run-time efficiency is irrelevant because the hardware is so fast. If I want to run a little piece of code on some web page, it doesn't matter whether the code takes 1 microsecond or 100 milliseconds to run, because in either case it happens instantaneously as far as the user is concerned. The important thing is that the code runs on whatever machine the user has and and doesn't crash.
     
  4. Feb 5, 2012 #3

    How about flash player? Flv video stream? It's a nightmare even on desktop comps. Flash player, Plugin-container for Firefox especially, eats up tons of my hardware resources and yield no satisfying results. And they have been updating it every week or so.
     
  5. Feb 5, 2012 #4

    phyzguy

    User Avatar
    Science Advisor

    I think video streaming needs to be fast so using Java is not an option. Getting software to run cleanly on the huge number of hardware platforms that are out there is not easy, which is why they keep updating it. I don't know the details.
     
  6. Feb 5, 2012 #5
    No, it's not. Android is Linux - i.e. it's written mostly in C & C++.

    The SDK is in Java. However, Android doesn't have a Java Virtual Machine. And it doesn't execute byte-code. It runs something called Dalvik - which I think is more like an executable than something regular java stuff.

    Anyway, a good programmer can architect a Java based application which runs faster than a C++ one made by a bad programmer - Check out mailinator - http://mailinator.blogspot.in/2007/01/architecture-of-mailinator.html
     
    Last edited: Feb 5, 2012
  7. Feb 5, 2012 #6
    For exactly that reason I have disabled the plugin-container in about:config of my firefox. sorry for going off topic but i just cannot resist it. The plugin-container is really kind of slow for video.
     
Know someone interested in this topic? Share this thread via Reddit, Google+, Twitter, or Facebook




Similar Discussions: Why chose Java?
  1. [Java] PNGException (Replies: 2)

  2. JAVA GridLayout (Replies: 1)

  3. Java interpreter (Replies: 8)

  4. Java Cylinders (Replies: 2)

Loading...