Minh Dương Blog

website·Indexed 29 days ago

https://teobatman00.github.io/minh-duong/

A personal blog and documentation site sharing knowledge on programming languages and finance. It features tutorials on Java (installation, syntax, comments, and history), Git project creation, and reference legal texts regarding Value Added Tax (VAT) in Vietnam.

Tokens
8.2K
Snippets
23
Records
49
Agent score
72%

What's inside Minh Dương Blog

  1. Overview of Java language characteristics

    Java is an object-oriented programming language designed around the principle of "write one, run anywhere (WORA)". This means compiled Java code can run on any platform that supports Java without needing to be recompiled. Key characteristics include:

    • Fully Object-Oriented: Everything in Java is associated with a predefined object; even the main method must reside within a class. Java uses interfaces to support multiple inheritance instead of the multi-inheritance model found in C++.
    • Cross-Platform: Java programs run on various operating systems (Windows, Unix, Linux, etc.) provided the Java Virtual Machine (JVM) is installed. This portability exists at both the source code level (consistent data types across hardware) and the binary level (bytecode).
    • Portable: Java applications can execute across different hardware and operating systems.
  2. Overview of Java language history and design principles

    Java was initiated in June 1991 by James Gosling, Mike Sheridan, and Patrick Naughton at Sun Microsystems (later acquired by Oracle in 2010) as part of the 'Green Team'. Originally designed for interactive televisions and embedded systems like set-top boxes, it evolved to become highly suitable for internet programming. The core design principles of Java include being simple, powerful, portable, platform-independent, secure, high-performance, multi-threaded, architecture-neutral, object-oriented, interpreted, and dynamic.
  3. Understand the role of the Java Virtual Machine (JVM)

    The Java Virtual Machine (JVM) is an interpreter that provides the environment for executing Java code. During compilation, Java source code is converted into .class files containing bytecode. The JVM then translates this bytecode into machine code specific to the host operating system and hardware.

    The JVM performs four primary tasks:

    1. Loads code
    2. Verifies code
    3. Executes code
    4. Provides the runtime environment
  4. Compare Java and C++ language characteristics

    Java differs from C++ in several fundamental ways: Java is a high-level, purely object-oriented language that is platform-independent ('Write Once, Run Anywhere'), whereas C++ is a middle-level language that is platform-dependent ('Write Once, Compile Anywhere'). Key technical differences include: Java supports both compilation and interpretation, provides built-in multi-threading support, and does not support pointers. Java manages system memory automatically, while C++ requires the developer to handle system management. Additionally, Java only supports call-by-value, while C++ supports both call-by-value and call-by-reference.
  5. Understand the Java Runtime Environment (JRE)

    The JRE is the runtime environment designed to support the execution of Java software. It ensures connectivity to memory and system resources. The JRE consists of:

    • Java Class Loader: Responsible for loading classes and linking them with Java libraries.
    • Java Virtual Machine (JVM): Ensures the application has sufficient resources to execute on the device or cloud environment.

    A key service provided by the JRE is Automatic Memory Management, which automates the allocation and release of memory for developers.

  6. Common use cases for Java

    Java is a versatile language used across various domains, including:

    • Application Development: Android apps, enterprise software, and video games.
    • Advanced Computing: Data science, cloud computing, Big Data analytics, Artificial Intelligence (AI), and the Internet of Things (IoT).
    • Server-side Technology: Powering servers such as Apache, JBoss, and GlassFish.
  7. Understand the Java Development Kit (JDK)

    The JDK is the software package used by developers to create Java applications. It is a standard implementation of the Java platform that includes the JRE, interpreters, and class libraries. Developers use the JDK to write and compile Java code, which is subsequently processed and run by the JVM and JRE.
  8. Determine VAT taxability and taxpayers in Vietnam

    VAT is calculated based on the added value of goods and services generated from production and circulation to consumption.

    Taxable Objects: Goods and services used for production, business, and consumption in Vietnam are subject to VAT, unless specifically exempted.

    Taxpayers:

    • Organizations and individuals producing or trading taxable goods and services (business establishments).
    • Organizations and individuals importing taxable goods (importers).
  9. Create and structure a basic Java class

    In Java, every line of code must reside within a class. The class name must start with an uppercase letter for every word (PascalCase). Crucially, the .java filename must exactly match the class name. Java is case-sensitive, meaning MyClass and myclass are treated as different identifiers.
    public class HelloWorld {
      public static void main(String[] args) {
        System.out.println("Hello World");
      }
    }
  10. Install Docusaurus and generate a new site

    To create a new Docusaurus site using the classic template, you must have Node.js version 18.0 or above installed. Run the initialization command in your terminal (Command Prompt, PowerShell, or integrated editor terminal) to generate the project and install all necessary dependencies.
    npm init docusaurus@latest my-website classic