Why java is portable:
Java:
Java is a programming language that produces software for multiple platforms. When a programmer registers a Java application, compiled code (known as bytecode) runs on most operating systems (OS), including Windows, Linux, and Mac. Java derives much of its syntax from C and C + programming languages.
Java is only Indonesia's fourth largest island, but contains more than half of the country's population and dominates it politically and economically. The capital of Java and the country is Jakarta (formerly Batavia), which is also Indonesia's largest city.
Features of Java:
The main reason behind the creation of Java was to bring portability and security functionality to a computer language. . In addition to these two main features, there were many other features that played an important role in shaping the final form of this excellent language, and therefore one of the reasons for Java security.
Of course, every time javacode is compiled, the compiler generates a byte code. Bytecodes that are generated are now safe and can run on any (portable) machine that has JVM. Bytecode is the key that makes the Java language safer and more portable.
Java is a portable:
• The idea is that the Java language is portable (or, more accurately, compiled byte code is portable). You are sure that each VM requires a specific implementation for a specific hardware profile. However, once this effort has been made, all Java byte code will be executed on this platform.
• Java source code is compiled in bytecode when using the javac compiler. The bytecode is saved to disk with the file extension .class.
• Java is a compiled programming language, but instead of compiling directly into executable machine code, it is compiled into an intermediate binary format called JVM byte code. Byte code is compiled and / or interpreted to execute the program.
The Java platform differs from most other platforms in that it is a software-based platform that runs on other hardware-based platforms. It has two components:
1. Runtime environment
2. API (Application Programming Interface)
Java code can run on various platforms, for example, Windows, Linux, Sun Solaris, Mac / OS, etc. Java code is compiled by the compiler and converted to bytecode. This bytecode is platform-independent code because it can be executed on multiple platforms, ie Write once and execute anywhere (WORA).
Language using Java:
The Java compiler provided by Oracle is written in Java. Basically, Java is using C through the native Java API. You can check the source code of any class in Java as the Object class and check if you want to use the C language they called api native in java.
Java runs on the JVM virtual machine - java. "Write Once, Turn Anywhere" (WORA) or sometimes "Write Once, Turn Anywhere" (WORE) was a motto created by Sun Microsystems to illustrate the benefits of the Java cross platform. Installing a JVM or Java interpreter on chips, devices, or software packages has become standard industry practice.
Java provides three distinct types of portability:
Source code portability: A given Java program must produce identical results, CPU, operating system, or underlying Java compiler.
CPU architecture portability: Today's Java compilers produce object code (called byte code) for a CPU that doesn't exist yet. For each actual CPU on which Java programs are to be executed, a Java interpreter or virtual machine executes code J. This nonexistent CPU allows you to execute the same object code on any CPU for which a Java interpreter exists.
OS / GUI: Java solves this problem by providing a set of library functions (contained in libraries provided by Java, such as awt, util, and lang) that converge with an imaginary operating system and an imaginary GUI. Just as the JVM has a virtual CPU, Java libraries have a virtual operating system / GUI.
Each Java implementation provides libraries that implement this virtual OS / GUI. Java programs that use these libraries to provide the necessary port of operating system and GUI functionality quite easily.
Java program structure:
Java program structure is the standard format released by the language developer for the industry programmer . Sun Micro System has prescribed the following structure for Java programmers for the development of Java applications. A package is a collection.
The Java data structure is “technically” different than the C and Pascal versions, because the Java data structure is a Class instead of a struct or a record. Now it has private data and public methods.
For More Info click here: Java Training in Chennai