Java is platform independent linguistic communication How?
Java programming linguistic communication provides platform independence, what does it hateful ? It agency same Java programme tin live on run on whatsoever platform or operating organization e.g. Windows, Linux or Solaris without whatsoever change. This is the nifty exercise goodness for about ane coming from platform subject programming linguistic communication similar C or C++ whose code needs to live on ported for every unmarried platform because they role native libraries, which differ inward every platform. Now inquiry comes how Java accomplish platform independence, what makes Java programs running on every platform without whatsoever change ? This is ane of the most footing inquiry Java programmer inquire when they foremost learning Java programming language. If y'all read farther y'all volition come upward to know almost class files, bytecode in addition to Java virtual machine which together provides platform independence to Java. One of the simplest analogy I tin associate alongside platform independence is the someone taking ruby rug alongside him in addition to instead of walking on floor, he ever walks on ruby carpet, no thing where he is walking. That ruby rug is the JVM, your Java programme runs on JVM rather on whatsoever special platform or machine.
Java Compilation in addition to execution
For those who don't know Java is both compiler in addition to interpreter language. When y'all compile a Java programme it creates .class file which is collection of byte code, these byte code are non machine pedagogy instead they are pedagogy which Java virtual machine tin understand. Since every Java programme runs on Java virtual machine, same byte code tin live on run on whatsoever platform. key is byte code is non machine pedagogy they are platform independent pedagogy to JVM. On the other manus JVM or Java virtual machine is platform subject because it converts byte code into machine flat pedagogy which is platform specific in addition to that's why y'all accept dissimilar version of JDK in addition to JRE for windows in addition to Linux because both JDK in addition to JRE comes alongside Java virtual machine. if y'all are confused betwixt JVM, JRE in addition to JDK in addition to thence read my most on difference betwixt JDK, JRE andJVM inward Java.
Byte code is created when y'all compile Java programme using Java compiler "javac" in addition to byte code runs on JVM which is created past times running "java" command. In special when y'all run "java" ascendancy it creates Java virtual machine, loads Main flat specified inward ascendancy business in addition to calls measure primary method inward java.
In summary combination of byte code in addition to JVM makes Java programme platform independent. Write ane time run everywhere was Java’s mantra when it started ruling programming terra firma inward mid in addition to late 90’s. Always remember, Java programs are platform independent merely JVM is not. That's why y'all accept dissimilar JVM in addition to JRE installation for dissimilar platform e.g Mac, Windows, Linux or Solaris. Similarly their are dissimilar JVM for 32-bit in addition to 64-bit machine.
Further Learning
Complete Java Masterclass
Java Fundamentals: The Java Language
Java In-Depth: Become a Complete Java Engineer!
No comments:
Post a Comment