Sharing knowledge and insight about Information Security.
Stampede
Friday, October 22, 2021
CPT307 Week 1 Interactive Assignment 2
CPT307
Week 1 Interactive Assignment 2
Java in 3 minutes
Definition
Java is an object-oriented, platform independent, high-level language that is interpreted by a Java Virtual Machine (JVM) and gains efficiency through use of just-in-time (JIT) compilers.
Core Principles
Since Java is an object-oriented language, it is influenced by the four principles of all object-oriented languages. These principles are:
Encapsulation:
The hiding of data implementation by restricting access.
Abstraction:
The development of classes, objects, and types in terms of their interfaces and functionality.
Inheritance:
The concept of creating a base class that has attributes shared by all objects. It becomes the parent of subclasses that further delineate objects by shared attributes.
Polymorphism:
The model of multiple methods having the same name. Two types of polymorphism exist in Java at the high level.
Run-time (overridding) determined by the assigned dynamic type of object.
Compile-time (overloading) determied by the complier.
When we write Java code, java compiler (javac) converts it to byte code. Javac is included in Java Development Kit (JDK). The byte code is then converted to machine-specific instructions via Java Virtual Machine (JVM). Machine-specific instructions are then run on the computer by Java Runtime Environment (JRE). JVM = Execution of a Java program. Because Java is a platform-independent language, it needs a virtual machine environment (interpreter) to run, which is provided by JVM. So, JVM is used to run Java code. Whenever we run a Java program either using JRE or JDK, it goes to JVM to be executed. JRE = JVM + Library Classes. JRE provides environment to run Java programs on our machines. JDK = JRE + Development Tools. JDK is used to develop and run Java code. It is used by developers.
No comments:
Post a Comment