본문 바로가기

Programming Language/Java

[Java] 1. Basics & Characteristics of Java

What is Java?

  • Java is a programming language that was released in 1995 by Sun Microsystems.
    • Developed in the lead of James Gosling. 
    • It's taken over by Oracle in 2009.
  • Started developing Java in 1991 to cover up the disadvantages of C and C++.
    • C and C++ needs to be coded and compiled depending on the utilized CPU. Thus, a huge cost and a lot of time is required to make programs compatible to every CPU.
  • You can check out the latest news related to Java here https://dev.java/

Characteristics of Java

  • Object-oriented Programming language (OOP)
    • A program consists of code and data.
    • Process-oriented: Code-driven programming paradigm.
    • Object-oriented: Data-driven programming paradigm.
  • Platform Independent language
    • Java code can be run on various platforms like Windows, Linux, macOS, etc. 
    • Java Compiler converts the Java code into byte code. This byte code enables to run the program on different platforms.
    • In C programming, a primary data type, 'int', takes 2 bytes in 32-bit architecture, and 4 bytes in 64-bit architecture. On the other hand, in Java programming, it takes 4 bytes whether in 32-bit architecture or in 64-bit architecture. 
    • Java is also called Write Once, Run Anywhere (WORA). 
  • Garbage Collection (GC)
    • Garbage Collection(GC) automatically identifies the allocated objects not required anymore by the program in run-time. GC manages to free up memory space by releasing those objects. 
    • The C programmers and C++ programmers needs to manually manage the memory space by free() for C and delete() for C++.
  • Secure
    • Java is used in Networked and Distributed Enviroment because of these features.
      • No explicit pointer usage.
      • Security Manager that determines the accessibility of resources by classes. 
      • Java program runs on the Java Virtual Machine (JVM).
      • Java Run-time Environment (JRE) includes a class loader that allows Java classes to be dynamically loaded to the JVM. This can improve security by separating packages that exist locally from packages that are imported from the network. 
  • Multi-threading
    •  A thread is an unit for a flow of a program. It's located inside of a process.
    • Java provides multi-threading feature which allows programs to execute two or more tasks at the same time resulting maximizing the CPU efficiency. 
  • Dynamic Loading
    • Static Loading: Loading the complete program and datas on the main memory before execute. 
    • Dynamic Loading: The complete program and datas are stored on the disk. The routines are invoked and loaded on the main memory only when it is required. The new routines are never loaded on the main memory.