<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Hayk Matshkalyan</title>
    <description>The latest articles on DEV Community by Hayk Matshkalyan (@hayk_matshkalian).</description>
    <link>https://dev.to/hayk_matshkalian</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F1157641%2F6f1d044f-0939-47aa-b5e5-a5c04aeca498.jpg</url>
      <title>DEV Community: Hayk Matshkalyan</title>
      <link>https://dev.to/hayk_matshkalian</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/hayk_matshkalian"/>
    <language>en</language>
    <item>
      <title>Mastering the Java Essentials: A Journey through Fundamentals, Types, and OOP</title>
      <dc:creator>Hayk Matshkalyan</dc:creator>
      <pubDate>Wed, 29 Nov 2023 16:41:27 +0000</pubDate>
      <link>https://dev.to/hayk_matshkalian/mastering-the-java-essentials-a-journey-through-fundamentals-types-and-oop-2pnh</link>
      <guid>https://dev.to/hayk_matshkalian/mastering-the-java-essentials-a-journey-through-fundamentals-types-and-oop-2pnh</guid>
      <description>&lt;p&gt;&lt;strong&gt;1. Java Fundamentals: Navigating the JVM and Compilation&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Java, the versatile programming language, relies on key concepts like the Java Virtual Machine (JVM), compilation, the Java Development Kit (JDK), and the Java Development Environment (JDE). Let's take a quick dive into these fundamental elements that empower Java's widespread usage.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Java Virtual Machine (JVM):&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Serves as a virtualized execution environment for Java applications.&lt;/li&gt;
&lt;li&gt;Translates Java bytecode into machine code during execution.&lt;/li&gt;
&lt;li&gt;Ensures platform independence, allowing Java programs to run on any device with a JVM.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Java Development Kit (JDK):&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Comprehensive toolkit for Java development.&lt;/li&gt;
&lt;li&gt;Includes Java Compiler (Javac), JVM, and standard libraries.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Java Development Environment (JDE):&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Set of tools for Java development, often referred to as an IDE.&lt;/li&gt;
&lt;li&gt;Features a code editor, compiler integration, debugger, and build automation.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Compilation Process:&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;1) &lt;strong&gt;Compilation with &lt;code&gt;javac&lt;/code&gt;:&lt;/strong&gt;&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt; - Java source code (.java) is compiled into bytecode (.class).
 - Example: _`javac YourProgram.java`_
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;2) &lt;strong&gt;Execution with JVM:&lt;/strong&gt;&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt; - Bytecode is executed by the JVM, dynamically translating it into machine code.
 - Example: _`java YourProgram`_
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;&lt;strong&gt;2. Types in Java: Unveiling the Variety&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Java is a statically typed language, meaning each variable must be declared with a specific data type. Explore the diverse types in Java, from the familiar primitive types like int and char to more complex non-primitive types such as classes, arrays, objects and interfaces. Understanding the nuances of types is crucial for writing robust and error-free Java code.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;3. Primitive vs. Non-primitive Types: Bridging the Divide&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Delve into the distinctions between primitive and non-primitive types in Java. While primitive types represent basic data values, non-primitive types encapsulate complex objects and structures. Uncover the differences in memory allocation, default values, and behavior, and learn when to use each type for optimal code performance.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;4. Object-Oriented Programming (OOP): A Paradigm for Powerful Java Development&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;OOP is the cornerstone of Java development, providing a modular and organized approach to building software. Embark on a journey into the principles of OOP, where everything revolves around objects, classes, and their interactions. Discover how OOP enhances code reuse, scalability, and maintainability in Java projects.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;5. The 4 Pillars of OOP: Building Strong Foundations&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;In the realm of OOP, four pillars stand tall, shaping the way we design and structure Java code:&lt;/p&gt;

&lt;p&gt;&lt;em&gt;Inheritance:&lt;/em&gt;&lt;br&gt;
Learn how classes can inherit properties and behaviors from others, fostering code reuse and creating hierarchical relationships.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;public class SportsCar extends Car {
    private boolean turbocharged;

    // Methods for sports cars go here
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;em&gt;Encapsulation:&lt;/em&gt;&lt;br&gt;
Explore the art of bundling data and methods into classes, promoting organization, security, and modular design.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;public class Car {
    private String model;
    private int year;

    // Methods for setting and getting data go here
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;em&gt;Abstraction:&lt;/em&gt;&lt;br&gt;
Uncover the power of abstraction, where complex systems are simplified through abstract classes and interfaces, providing a clear blueprint for implementation.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;public abstract class Shape {
    abstract double calculateArea();
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;em&gt;Polymorphism:&lt;/em&gt;&lt;br&gt;
Dive into the magic of polymorphism, allowing methods to take on multiple forms, fostering flexibility and adaptability in Java code.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;public class Dog extends Animal {
    @Override
    public void makeSound() {
        System.out.println("Bark!");
    }
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Mastering these pillars empowers Java developers to create robust, scalable, and maintainable applications that stand the test of time.&lt;/p&gt;

</description>
    </item>
    <item>
      <title>Binary Mathematics: The Foundation of Digital Computing, Converting and Operations</title>
      <dc:creator>Hayk Matshkalyan</dc:creator>
      <pubDate>Tue, 12 Sep 2023 17:48:04 +0000</pubDate>
      <link>https://dev.to/hayk_matshkalian/binary-mathematics-the-foundation-of-digital-computing-converting-and-operations-dk1</link>
      <guid>https://dev.to/hayk_matshkalian/binary-mathematics-the-foundation-of-digital-computing-converting-and-operations-dk1</guid>
      <description>&lt;p&gt;Binary math is a system of mathematics that uses only two digits: 0 and 1. It's the foundation of digital computing and is used to represent and manipulate information in computers. In binary math:&lt;/p&gt;

&lt;p&gt;Numbers: Numbers are represented using combinations of 0s and 1s. Each digit in a binary number represents a power of 2, starting from the right and increasing by one for each digit to the left. For example, the binary number "1101" represents 1*(2^3) + 1*(2^2) + 0*(2^1) + 1*(2^0), which equals 13 in decimal (base-10) notation.&lt;/p&gt;

&lt;p&gt;Operations: Basic arithmetic operations like addition, subtraction, multiplication, and division can be performed using binary digits. These operations follow similar rules to those in decimal math but with simpler outcomes because there are only two digits involved.&lt;/p&gt;

&lt;p&gt;Logic: Binary math is closely tied to binary logic, where 0 typically represents "false" and 1 represents "true." This logic is fundamental in computer programming, where it's used to make decisions and perform computations.&lt;/p&gt;

&lt;p&gt;Data Storage: Computers use binary math to store and process data. All data, including text, images, and videos, is ultimately represented in binary form as combinations of 0s and 1s.&lt;/p&gt;

&lt;p&gt;Operations:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Binary Addition:&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Binary addition is similar to decimal addition but with only two possible values: 0 and 1.&lt;br&gt;
When adding two binary numbers, you start from the rightmost bit and move left.&lt;br&gt;
If you add 0 and 0, the result is 0. If you add 1 and 0, the result is 1. If you add 1 and 1, the result is 10 (carry-over 1 to the next bit).&lt;br&gt;
Carry-overs are important in binary addition, just as in decimal addition. They propagate from right to left until there's no more carry-over.&lt;br&gt;
Example: 1101 + 101 = 10010 (in binary).&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Binary Subtraction:&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Binary subtraction also resembles decimal subtraction but with two possible values: 0 and 1.&lt;br&gt;
When subtracting binary numbers, you start from the rightmost bit and move left.&lt;br&gt;
If you subtract 0 from 0, the result is 0. If you subtract 1 from 0, you borrow 1 from the next higher bit (if possible) and subtract 1 from 10, resulting in 1. If you subtract 1 from 1, the result is 0.&lt;br&gt;
Borrowing is crucial in binary subtraction, similar to decimal subtraction.&lt;br&gt;
Example: 1101 - 101 = 100 (in binary).&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Binary Multiplication:&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Binary multiplication involves multiplying two binary numbers, bit by bit.&lt;br&gt;
Start with the rightmost bit of the second number and multiply it by each bit of the first number, shifting one position to the left with each step.&lt;br&gt;
Just like in decimal multiplication, you can have carry-overs when multiplying. If the product of two bits is 2, carry over 1.&lt;br&gt;
Example: 1011 * 10 = 10110 (in binary).&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Binary Division:&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Binary division is similar to decimal long division but uses 0 and 1 as digits.&lt;br&gt;
You start by comparing the leftmost bits of the dividend and the divisor.&lt;br&gt;
If the divisor is smaller or equal to the dividend, you subtract and write down the quotient (0 or 1) and bring down the next bit.&lt;br&gt;
Continue this process until you've worked through all the bits.&lt;br&gt;
Example: 10101 / 11 = 11 with a remainder of 1 (in binary).&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Conversion to Base-8 (Octal):&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;1) Group the binary digits: 001 101 101.&lt;br&gt;
2) Convert each group to octal: 1 5 5.&lt;br&gt;
3) Combine the octal digits: 155.&lt;/p&gt;

&lt;p&gt;So, 1101101 in base-2 is equivalent to 155 in base-8.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Conversion to Base-10 (Decimal):&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;1) Start from the rightmost digit.&lt;br&gt;
2) 1 * 2^0 + 0 * 2^1 + 1 * 2^2 + 1 * 2^3 + 0 * 2^4 + 1 * 2^5 + 1 * 2^6 = 1 + 0 + 4 + 8 + 0 + 32 + 64 = 109.&lt;/p&gt;

</description>
    </item>
  </channel>
</rss>
