Engineering Blog
11 subscribers
69 photos
76 links
Software Engineer @ EPAM Systems
CS @ Millat Umidi University

Talks about:
๐Ÿ“— OS
๐Ÿ“• Networking
๐Ÿ“™ Backend Engineering
๐Ÿ“˜ RDBMS & NoSQL
๐Ÿ“• DS & ALGO
Download Telegram
Channel created
Channel name was changed to ยซasldev ๐Ÿ–ฅยป
Bismillah!
Taxminan 3 soatda bugungi leetcode daily challengeni yechdim.Alhamdulillah.
Program vs Process vs Thread

Program - is an executable file that contains set of instructions.It is stored passively on disk.

Process - When the Program is loaded into the memory and is active, it becomes Process.It will require some resources, such as counter, stack and etc..

Thread - is the smallest unit of execution within a process.One process can have one or more Threads.

e.g. In your laptop, you have Microsoft Word (Program).When you click it, it will be opened (Process).When you are writing on doc (Thread).
JDK vs JRE vs JVM

Let's imagine a case where we can use above terms. Basically in programming we have two types of people:
โ€ข user
โ€ข developer

For user, to run a compiled java programs (jar files), they only need JRE (Java Runtime Environment). JRE contains necessary libraries and JVM (Java Virtual Machine) to run a compiled Java programs.

Simply, JRE is for running compiled Java programs.

For developer however, they need JDK (Java Development Kit), because it contains necessary tools to create java programs. For example, debugger and much more.

JVM is a machine that takes .class files and turns them into machine specific instructions that finally CPU process.
Leetcode2231. Largest Number After Digit Swaps by Parity

Problem Description: You are given a positive integer num. You may swap any two digits of num that have the same parity (i.e. both odd digits or both even digits).

Return the largest possible value of num after any number of swaps.
Platform Independence

Java is a platform independent language. It follows, write once, run anywhere. How does Java achieve this?
Well, with the help of JVM. Basically, JVM takes .class file and turns it into machine specific code.Therefore, whenever we install jdk or jre, we choose OS that we are running on.