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

@@ -53,7 +53,7 @@ What does Java consist of?Java consists of multiple main components. The first o
Img. 1 - TIOBE Programming Community Index
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.">
<meta itemprop="wordCount" content="89">
<meta itemprop="wordCount" content="468">
<meta name="twitter:card" content="summary">
<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.
@@ -336,6 +336,99 @@ Its fairly easy It has a broad spectre of usage Server Desktop Mobile devices
<p>
<img src="../assets/compilation-process-simplified.svg" alt="Compilation Process Simplified" loading="lazy" />
<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 class="hx:mt-16"></div>