update prog-intro course

This commit is contained in:
2026-02-21 13:35:42 +03:00
parent bb3ef5c28c
commit e7f272d9f6
10 changed files with 187 additions and 4 deletions

File diff suppressed because one or more lines are too long

Before

Width:  |  Height:  |  Size: 7.4 KiB

After

Width:  |  Height:  |  Size: 46 KiB

File diff suppressed because one or more lines are too long

After

Width:  |  Height:  |  Size: 48 KiB

File diff suppressed because one or more lines are too long

After

Width:  |  Height:  |  Size: 53 KiB

View File

@@ -25,3 +25,67 @@ Java consists of multiple main components. The first one being the **Java compil
![Compilation Process Simplified](assets/compilation-process-simplified.svg) ![Compilation Process Simplified](assets/compilation-process-simplified.svg)
*Img.2 - Simplified Compilation Process* *Img.2 - Simplified Compilation Process*
The behaviour of the Java compiler is described by the [Java Language Specification](https://docs.oracle.com/javase/specs/) or JLS.
Let's talk about compilers a little bit. For example if we will take *C++*. If we take C++ compiler for *x86-64* platform and *Windows* operating system, and launch the compiler on source code it will turn it directly into assembly code.
![C++ code compilation under x86-64](assets/cpp-x86-64-compilation.svg)
*Img. X -- C++ code compilation process under x86-64 architecture.*
But what if I want to run my program on *Linux* instead of Windows. I will need to take a different compiler under different operating system and recompile my code using a new compiler. It's not very convenient.
Java tries to protect us from that. By converting the *Java source code* into *Java byte code*. And then the *byte code* will be ran on the *Java virtual machine* which will run our program on the native processor.
![Java code compilation](assets/java-code-compilation.svg)
*Img. X -- Java code compilation*
This approach allows to change only **JVM** according to our platform (*x86_64, ARM, ...*) and operating system (*Windows, MacOS, GNU-Linux, ...*) while *byte code* stays the same. We can only write our code once, than compile it and run under everywhere.
As the motto says:
> Write once -- ~debug~ run everywhere.
The third component of Java is the standart library which is included in the JVM.
There are multiple redactions of Java-platforms:
* Standart edition
- *For regular aplications*
* Enterprise edition
- *For server aplications*
* Micro-edition
- *For mobile aplications*
- *Isn't in use nowadays 🪦*
* Java Card
- *Sim- and smart-cards*
There also were multiple versions of Java throughout its history.
- JDK 1.0 (Jan 1996)
- J2SE 1.2 (Dec 1998)
* *Collections Framework*
- J2SE 5.0 (Sep 2004)
* *Generics*
- Java SE 8 (Mar 2014)
* *Streams and Lambdas*
- Java SE 9 (Sep 2017)
* *Modules*
- Java SE 10 (Mar 2018)
* `var`
- Java 11 (Sep 2018)
* `jshell`
- Java 17 [LTS-old] (Sep 2021)
* *Previous stable version*
* *Many little changes*
- Java 21 [LTS] (Sep 2023)
* *Current stable version*
- Java 25 (Sep 2025)
* *Next version*
Java comes in two parts: **JDK - Java Development Kit** and **JVM - Java Virtual Machine**.
There is also a **JRE - Java Runtime Environment**. For example if we want to run our code somewhere on the server we don't need to compile it there because we have our byte code and we just need JRE to run it.

File diff suppressed because one or more lines are too long

After

Width:  |  Height:  |  Size: 38 KiB

File diff suppressed because one or more lines are too long

Before

Width:  |  Height:  |  Size: 7.4 KiB

After

Width:  |  Height:  |  Size: 46 KiB

File diff suppressed because one or more lines are too long

After

Width:  |  Height:  |  Size: 48 KiB

File diff suppressed because one or more lines are too long

After

Width:  |  Height:  |  Size: 53 KiB

View File

@@ -53,7 +53,7 @@ What does Java consist of?Java consists of multiple main components. The first o
Img. 1 - TIOBE Programming Community Index Img. 1 - TIOBE Programming Community Index
Also, Java has a lot of advantages for beginners such as: Also, Java has a lot of advantages for beginners such as:
Its fairly easy It has a broad spectre of usage Server Desktop Mobile devices Smart-cards What does Java consist of?Java consists of multiple main components. The first one being the Java compiler. The process of converting human-readable text to machine code is called compilation."> Its fairly easy It has a broad spectre of usage Server Desktop Mobile devices Smart-cards What does Java consist of?Java consists of multiple main components. The first one being the Java compiler. The process of converting human-readable text to machine code is called compilation.">
<meta itemprop="wordCount" content="89"> <meta itemprop="wordCount" content="468">
<meta name="twitter:card" content="summary"> <meta name="twitter:card" content="summary">
<meta name="twitter:title" content="Lecture 1. Introduction"> <meta name="twitter:title" content="Lecture 1. Introduction">
<meta name="twitter:description" content="Why do we choose Java?According to TIOBE Programming Community Index Java is one of the most demanded languages in the programming field. <meta name="twitter:description" content="Why do we choose Java?According to TIOBE Programming Community Index Java is one of the most demanded languages in the programming field.
@@ -336,6 +336,99 @@ Its fairly easy It has a broad spectre of usage Server Desktop Mobile devices
<p> <p>
<img src="../assets/compilation-process-simplified.svg" alt="Compilation Process Simplified" loading="lazy" /> <img src="../assets/compilation-process-simplified.svg" alt="Compilation Process Simplified" loading="lazy" />
<em>Img.2 - Simplified Compilation Process</em></p> <em>Img.2 - Simplified Compilation Process</em></p>
<p>The behaviour of the Java compiler is described by the <a href="https://docs.oracle.com/javase/specs/"target="_blank" rel="noopener">Java Language Specification</a> or JLS.</p>
<p>Let&rsquo;s talk about compilers a little bit. For example if we will take <em>C++</em>. If we take C++ compiler for <em>x86-64</em> platform and <em>Windows</em> operating system, and launch the compiler on source code it will turn it directly into assembly code.</p>
<p>
<img src="../assets/cpp-x86-64-compilation.svg" alt="C&#43;&#43; code compilation under x86-64" loading="lazy" />
<em>Img. X &ndash; C++ code compilation process under x86-64 architecture.</em></p>
<p>But what if I want to run my program on <em>Linux</em> instead of Windows. I will need to take a different compiler under different operating system and recompile my code using a new compiler. It&rsquo;s not very convenient.</p>
<p>Java tries to protect us from that. By converting the <em>Java source code</em> into <em>Java byte code</em>. And then the <em>byte code</em> will be ran on the <em>Java virtual machine</em> which will run our program on the native processor.</p>
<p>
<img src="../assets/java-code-compilation.svg" alt="Java code compilation" loading="lazy" />
<em>Img. X &ndash; Java code compilation</em></p>
<p>This approach allows to change only <strong>JVM</strong> according to our platform (<em>x86_64, ARM, &hellip;</em>) and operating system (<em>Windows, MacOS, GNU-Linux, &hellip;</em>) while <em>byte code</em> stays the same. We can only write our code once, than compile it and run under everywhere.</p>
<p>As the motto says:</p>
<blockquote>
<p>Write once &ndash; <del>debug</del> run everywhere.</p>
</blockquote>
<p>The third component of Java is the standart library which is included in the JVM.</p>
<p>There are multiple redactions of Java-platforms:</p>
<ul>
<li>Standart edition
<ul>
<li><em>For regular aplications</em></li>
</ul>
</li>
<li>Enterprise edition
<ul>
<li><em>For server aplications</em></li>
</ul>
</li>
<li>Micro-edition
<ul>
<li><em>For mobile aplications</em></li>
<li><em>Isn&rsquo;t in use nowadays 🪦</em></li>
</ul>
</li>
<li>Java Card
<ul>
<li><em>Sim- and smart-cards</em></li>
</ul>
</li>
</ul>
<p>There also were multiple versions of Java throughout its history.</p>
<ul>
<li>JDK 1.0 (Jan 1996)</li>
<li>J2SE 1.2 (Dec 1998)
<ul>
<li><em>Collections Framework</em></li>
</ul>
</li>
<li>J2SE 5.0 (Sep 2004)
<ul>
<li><em>Generics</em></li>
</ul>
</li>
<li>Java SE 8 (Mar 2014)
<ul>
<li><em>Streams and Lambdas</em></li>
</ul>
</li>
<li>Java SE 9 (Sep 2017)
<ul>
<li><em>Modules</em></li>
</ul>
</li>
<li>Java SE 10 (Mar 2018)
<ul>
<li><code>var</code></li>
</ul>
</li>
<li>Java 11 (Sep 2018)
<ul>
<li><code>jshell</code></li>
</ul>
</li>
<li>Java 17 [LTS-old] (Sep 2021)
<ul>
<li><em>Previous stable version</em></li>
<li><em>Many little changes</em></li>
</ul>
</li>
<li>Java 21 [LTS] (Sep 2023)
<ul>
<li><em>Current stable version</em></li>
</ul>
</li>
<li>Java 25 (Sep 2025)
<ul>
<li><em>Next version</em></li>
</ul>
</li>
</ul>
<p>Java comes in two parts: <strong>JDK - Java Development Kit</strong> and <strong>JVM - Java Virtual Machine</strong>.</p>
<p>There is also a <strong>JRE - Java Runtime Environment</strong>. For example if we want to run our code somewhere on the server we don&rsquo;t need to compile it there because we have our byte code and we just need JRE to run it.</p>
</div> </div>
<div class="hx:mt-16"></div> <div class="hx:mt-16"></div>

File diff suppressed because one or more lines are too long