<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Heshani Yapa on Medium]]></title>
        <description><![CDATA[Stories by Heshani Yapa on Medium]]></description>
        <link>https://medium.com/@Heshani.y?source=rss-1af0d3d60e51------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*QZlxO1Dp32yZpUoKvyehnw.jpeg</url>
            <title>Stories by Heshani Yapa on Medium</title>
            <link>https://medium.com/@Heshani.y?source=rss-1af0d3d60e51------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sat, 28 Nov 2026 06:49:56 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@Heshani.y/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[CS BASICS 101: Git & Version Control Systems (VCS)]]></title>
            <link>https://medium.com/@Heshani.y/cs-basics-101-git-version-control-systems-vcs-e7962c627017?source=rss-1af0d3d60e51------2</link>
            <guid isPermaLink="false">https://medium.com/p/e7962c627017</guid>
            <category><![CDATA[version-control-system]]></category>
            <category><![CDATA[github]]></category>
            <category><![CDATA[git]]></category>
            <category><![CDATA[github-actions]]></category>
            <category><![CDATA[vc]]></category>
            <dc:creator><![CDATA[Heshani Yapa]]></dc:creator>
            <pubDate>Sun, 27 Sep 2026 08:07:14 GMT</pubDate>
            <atom:updated>2026-09-27T08:07:14.941Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/860/1*cokM6taJSi3tOmhLJsmYKA.jpeg" /><figcaption>git Logo SOURCE: Google Image Search</figcaption></figure><p>You have probably heard of one or a few of these terms as a student in IT or CS: <strong>VCS</strong> (the concept/system for tracking changes), <strong>Git</strong> (a specific VCS), <strong>GitHub</strong> (an online platform for hosting Git repositories and collaborating). And wondered more about them. Well, you’re in luck, as this article explores that very same topic :)</p><h3>1. What is VCS?</h3><p><strong>VCS = Version Control System.</strong></p><p>A Version Control System is software that <strong>tracks changes made to files over time</strong>.</p><p>It allows developers to:</p><ul><li>Save different versions of their code</li><li>See what changed</li><li>See who made changes</li><li>Restore previous versions</li><li>Work with other developers</li><li>Work on different features simultaneously</li><li>Prevent/resolve conflicting changes</li><li>Maintain a history of a project</li></ul><h3>Simple example</h3><p>Imagine you’re developing a Java application.</p><p>You have:</p><pre>Calculator.java</pre><p>Monday:</p><pre>intadd(inta,intb) {returna+b;<br>}</pre><p>Tuesday, you modify it:</p><pre>intadd(inta,intb) {returna+b+10;<br>}</pre><p>Oops. You realize your Tuesday change was wrong. Without VCS, you might have to manually reconstruct the old code. With VCS, you can simply go back to the earlier version.</p><h3>2. Why do we need Version Control?</h3><p>Imagine a team of 5 developers working on one project.</p><p>Without version control, you might get:</p><pre>project_final.zip<br>project_final2.zip<br>project_final_REAL.zip<br>project_final_REAL_NEW.zip<br>project_final_REAL_NEW_USE_THIS.zip</pre><p>This becomes a nightmare. A VCS solves this by maintaining a <strong>history of changes</strong>.</p><p>For example:</p><pre>Version 1<br>   ↓<br>Version 2<br>   ↓<br>Version 3<br>   ↓<br>Version 4<br>   ↓<br>Version 5</pre><p>Each version can contain information such as:</p><pre>Who made the change?<br>When?<br>What changed?<br>Why?</pre><h3>3. Main functions of a VCS</h3><p>A VCS generally provides:</p><h3>-Version tracking</h3><p>Tracks changes to files.</p><h3>-History</h3><p>Maintains a history of previous versions.</p><h3>-Revert/restore</h3><p>Allows you to return to an earlier version.</p><h3>-Collaboration</h3><p>Multiple developers can work on the same project.</p><h3>-Branching</h3><p>Developers can work on different features independently.</p><h3>-Merging</h3><p>Changes from different branches can be combined.</p><h3>-Conflict management</h3><p>If two developers modify the same part of a file, the VCS can identify the conflict.</p><h3>-Accountability</h3><p>You can see who made a particular change.</p><h3>4. Types of Version Control Systems</h3><p>There are three broad approaches.</p><h3>A. Local Version Control System</h3><p>Everything is stored on one computer.</p><pre>Your Computer<br>      |<br>      ├── Version 1<br>      ├── Version 2<br>      ├── Version 3<br>      └── Version 4</pre><p>Example:</p><p><strong>RCS</strong></p><p>The major disadvantage is that collaboration is difficult.</p><h3>5. Centralized Version Control System — CVCS</h3><p>Here, there is a <strong>central server</strong> containing the repository.</p><p>Examples:</p><ul><li>SVN</li><li>CVS</li><li>Perforce</li></ul><p>Architecture:</p><pre>Central Server<br>         ┌─────────────┐<br>         │ Repository  │<br>         └──────┬──────┘<br>                │<br>    ┌───────────┼───────────┐<br>    ↓           ↓           ↓<br> Developer   Developer   Developer<br>    A           B           C</pre><p>Developers obtain files from the central server and send changes back.</p><h3>Problem</h3><p>The central server is very important.</p><p>If it goes down, developers may have difficulty accessing the repository.</p><h3>6. Distributed Version Control System — DVCS</h3><p>Git belongs here.</p><p>In a <strong>Distributed Version Control System</strong>, each developer has a complete repository/history locally.</p><p>Examples:</p><ul><li><strong>Git</strong></li><li>Mercurial</li></ul><p>Architecture:</p><pre>Remote Repository<br>              GitHub<br>                │<br>   ┌────────────┼────────────┐<br>   ↓            ↓            ↓<br>Developer A  Developer B  Developer C<br>Repository   Repository   Repository</pre><p>Each developer can have the project’s history on their own machine.</p><p>This is one of Git’s major strengths.</p><h3>7. What is Git?</h3><p><strong>Git is a distributed version control system.</strong></p><p>It was originally created by <strong>Linus Torvalds</strong> in 2005.</p><p>Git is used to track changes in software projects.</p><p>For example:</p><pre>MyProject/<br>│<br>├── src/<br>│   ├── Main.java<br>│   └── Student.java<br>│<br>├── README.md<br>└── pom.xml</pre><p>Git can track changes to these files.</p><h3>8. Git vs GitHub</h3><p>This is VERY important.</p><h3>Git</h3><p>A <strong>version control system/software</strong>.</p><p>It runs on your computer.</p><h3>GitHub</h3><p>An <strong>online platform</strong> that hosts Git repositories and provides collaboration features.</p><p>Think:</p><pre>Git<br>↓<br>Version control</pre><p>and:</p><pre>GitHub<br>↓<br>Online hosting + collaboration</pre><p>Other platforms can also host Git repositories:</p><ul><li>GitLab</li><li>Bitbucket</li><li>Azure Repos</li></ul><p>So:</p><blockquote><strong><em>Git ≠ GitHub</em></strong></blockquote><h3>9. How Git works</h3><p>This is the most important part.</p><p>Git primarily involves:</p><pre>Working Directory<br>       ↓<br>     Staging Area<br>       ↓<br>     Local Repository<br>       ↓<br>   Remote Repository</pre><p>Let’s understand each one.</p><h3>10. Working Directory</h3><p>This is the project you’re currently working on.</p><p>Example:</p><pre>MyProject/<br>│<br>├── Main.java<br>├── Student.java<br>└── README.md</pre><p>You edit these files normally.</p><p>Suppose you modify:</p><pre>System.out.println(&quot;Hello&quot;);</pre><p>to:</p><pre>System.out.println(&quot;Hello World&quot;);</pre><p>Git notices that the file has changed.</p><h3>11. Staging Area</h3><p>Before saving a version permanently, Git allows you to choose which changes should be included.</p><p>This is called the <strong>staging area</strong>.</p><p>You use:</p><pre>git add</pre><p>Example:</p><pre>git add Main.java</pre><p>Now:</p><pre>Working Directory<br>       ↓<br>    git add<br>       ↓<br> Staging Area</pre><p>You are basically saying:</p><blockquote><em>“Git, I want this change included in my next version.”</em></blockquote><h3>12. Local Repository</h3><p>After staging your changes, you create a <strong>commit</strong>.</p><pre>git commit</pre><p>A commit records a snapshot of your project at that point.</p><p>So:</p><pre>Working Directory<br>       ↓<br>    git add<br>       ↓<br> Staging Area<br>       ↓<br>   git commit<br>       ↓<br>Local Repository</pre><h3>13. What is a commit?</h3><p>A <strong>commit</strong> is a recorded snapshot of changes in a Git repository.</p><p>For example:</p><pre>Commit 1<br>&quot;Created student class&quot;</pre><pre>Commit 2<br>&quot;Added database connection&quot;</pre><pre>Commit 3<br>&quot;Added login functionality&quot;</pre><pre>Commit 4<br>&quot;Fixed login validation&quot;</pre><p>Each commit has an identifier called a <strong>commit hash</strong>.</p><p>Example:</p><pre>a84f91c</pre><p>A real Git commit hash may look like:</p><pre>a84f91c82d7e3b9...</pre><p>The hash identifies that particular commit.</p><h3>14. Why are commits important?</h3><p>Imagine your project history:</p><pre>Initial project<br>      ↓<br>Added login<br>      ↓<br>Added database<br>      ↓<br>Added payment<br>      ↓<br>Bug introduced</pre><p>You can investigate the history and determine what changed.</p><p>You can also compare versions.</p><p>This is why developers are encouraged to make <strong>small, meaningful commits</strong>.</p><p>For example:</p><p>Good:</p><pre>Add user login validation<br>Fix database connection<br>Add student search</pre><p>Bad:</p><pre>stuff<br>changes<br>final<br>final2</pre><h3>15. Remote Repository</h3><p>A remote repository is a Git repository stored somewhere other than your local machine.</p><p>For example:</p><p><strong>GitHub</strong></p><pre>Your Computer<br>     |<br>     | push<br>     ↓<br>   GitHub</pre><p>This allows you to:</p><ul><li>Backup your repository</li><li>Collaborate with others</li><li>Share code</li><li>Access the project from another computer</li></ul><h3>16. The complete Git workflow</h3><p>This is the fundamental workflow:</p><pre>Edit files<br>                 ↓<br>          Working Directory<br>                 ↓<br>             git add<br>                 ↓<br>           Staging Area<br>                 ↓<br>           git commit<br>                 ↓<br>        Local Repository<br>                 ↓<br>             git push<br>                 ↓<br>        Remote Repository<br>             (GitHub)</pre><p>And when you want to get changes from GitHub:</p><pre>GitHub<br>   ↓<br>git pull<br>   ↓<br>Local Repository<br>   ↓<br>Working Directory</pre><h3>17. Creating a Git repository</h3><p>Suppose you create:</p><pre>MyProject</pre><p>Open the terminal inside it:</p><pre>cd MyProject</pre><p>Then:</p><pre>git init</pre><p>This initializes a Git repository.</p><p>Git creates a hidden directory:</p><pre>.git</pre><p>So:</p><pre>MyProject/<br>│<br>├── .git/<br>├── Main.java<br>└── README.md</pre><p>The .git directory contains Git&#39;s repository information.</p><p><strong>Do not manually modify </strong><strong>.git unless you know exactly what you&#39;re doing.</strong></p><h3>18. Checking Git status</h3><p>Use:</p><pre>git status</pre><p>It tells you what is happening in your repository.</p><p>For example:</p><pre>modified: Main.java<br>untracked: Student.java</pre><h3>19. Untracked files</h3><p>Suppose you create:</p><pre>Student.java</pre><p>Git doesn’t automatically start tracking it.</p><p>It is initially:</p><pre>Untracked</pre><p>You can stage it:</p><pre>git add Student.java</pre><p>Now Git knows that you want it included in the next commit.</p><h3>20. git add</h3><p>You can add one file:</p><pre>git add Main.java</pre><p>Multiple files:</p><pre>git add Main.java Student.java</pre><p>Or all appropriate changes in the current directory:</p><pre>git add .</pre><p>Then:</p><pre>git commit-m&quot;Add student functionality&quot;</pre><h3>21. git commit</h3><p>Basic syntax:</p><pre>git commit-m&quot;message&quot;</pre><p>Example:</p><pre>git commit-m&quot;Add student registration&quot;</pre><p>The -m means you&#39;re providing the commit message directly.</p><h3>22. Git history</h3><p>Use:</p><pre>git log</pre><p>You’ll see previous commits.</p><p>For a shorter version:</p><pre>git log--oneline</pre><p>Example:</p><pre>8f32abc Add login validation<br>72ac891 Add database connection<br>19bd321 Create project structure</pre><h3>23. Git branches</h3><p>This is one of Git’s most important concepts.</p><p>Suppose you’re developing an application.</p><p>The main project is:</p><pre>main</pre><p>You want to create a login feature.</p><p>Instead of directly modifying the main code, you can create:</p><pre>login-feature</pre><p>So:</p><pre>main<br>              |<br>              |<br>              ├───────────────<br>              |<br>              └── login-feature</pre><p>You work on the feature separately.</p><h3>24. Why use branches?</h3><p>Branches allow developers to work independently.</p><p>For example:</p><pre>main<br>│<br>├── login<br>│<br>├── payment<br>│<br>├── user-profile<br>│<br>└── bug-fix</pre><p>Developer A:</p><pre>login</pre><p>Developer B:</p><pre>payment</pre><p>Developer C:</p><pre>user-profile</pre><p>They can work without constantly interfering with the main branch.</p><h3>25. Creating a branch</h3><p>Modern Git:</p><pre>git switch-c login</pre><p>or:</p><pre>git checkout-b login</pre><p>The second command is older but still widely encountered.</p><h3>26. Switching branches</h3><pre>git switch main</pre><p>Then:</p><pre>git switch login</pre><p>Older syntax:</p><pre>git checkout main</pre><h3>27. Merging branches</h3><p>Suppose you’ve finished your login feature.</p><p>You want to combine it with main.</p><p>First:</p><pre>git switch main</pre><p>Then:</p><pre>git merge login</pre><p>Conceptually:</p><pre>login<br>            /    \<br>           /      \<br>          /        \<br>---------●----------●<br>        main       merge</pre><p>The changes from login are incorporated into main.</p><h3>28. Merge conflicts</h3><p>This is VERY important in real development.</p><p>Suppose Developer A changes:</p><pre>Stringname=&quot;Kamal&quot;;</pre><p>to:</p><pre>Stringname=&quot;Nimal&quot;;</pre><p>Developer B changes the same line to:</p><pre>Stringname=&quot;Amal&quot;;</pre><p>Git can’t automatically know which one is correct.</p><p>You get a:</p><blockquote><strong><em>Merge conflict</em></strong></blockquote><p>Git may show:</p><pre>&lt;&lt;&lt;&lt;&lt;&lt;&lt; HEAD<br>String name = &quot;Nimal&quot;;<br>=======<br>String name = &quot;Amal&quot;;<br>&gt;&gt;&gt;&gt;&gt;&gt;&gt; branch</pre><p>The developer must decide which version should remain.</p><p>Then:</p><pre>git add .git commit</pre><h3>29. git clone</h3><p>Suppose someone has a repository on GitHub.</p><p>You want a copy on your computer.</p><p>Use:</p><pre>git clone &lt;repository-url&gt;</pre><p>For example:</p><pre>git clone &lt;https://github.com/user/project.git&gt;</pre><p>This downloads the repository and its history.</p><p>So:</p><pre>GitHub<br>   ↓<br>git clone<br>   ↓<br>Your computer</pre><h3>30. git push</h3><p>Suppose you’ve made commits locally.</p><p>To send them to GitHub:</p><pre>git push</pre><p>Conceptually:</p><pre>Local Repository<br>      ↓<br>   git push<br>      ↓<br>GitHub Repository</pre><h3>31. git pull</h3><p>Suppose another developer pushed changes to GitHub.</p><p>Your local copy doesn’t automatically contain those changes.</p><p>You can use:</p><pre>git pull</pre><p>Conceptually:</p><pre>GitHub<br>   ↓<br>git pull<br>   ↓<br>Your local repository</pre><p>git pull generally fetches remote changes and integrates them into your current branch.</p><h3>32. git fetch</h3><p>git fetch also gets information/changes from the remote repository, but it <strong>doesn&#39;t automatically merge those changes into your current branch</strong>.</p><p>So:</p><h3>git fetch</h3><blockquote><em>“Show/get me what’s changed remotely.”</em></blockquote><h3>git pull</h3><blockquote><em>“Get the remote changes and integrate them into my current branch.”</em></blockquote><p>This distinction is useful in exams and real projects.</p><h3>33. Git remote</h3><p>You can see your remote repositories using:</p><pre>git remote-v</pre><p>You might see:</p><pre>origin  &lt;https://github.com/user/project.git&gt;</pre><h3>34. What is origin?</h3><p>origin is normally the default name Git gives to the remote repository from which your local repository was cloned.</p><p>For example:</p><pre>origin<br>   ↓<br>GitHub repository</pre><p>So:</p><pre>git push origin main</pre><p>means approximately:</p><blockquote><em>Push my local </em><em>main branch to the remote named </em><em>origin.</em></blockquote><h3>35. Git’s most important commands</h3><p>git init Create a Git repository</p><p>git clone Copy an existing repository</p><p>git status Show repository status</p><p>git add Stage changes</p><p>git commit Record changes</p><p>git log View commit history</p><p>git branch Manage branches</p><p>git switch Switch branches</p><p>git merge Combine branches</p><p>git fetch Download remote information</p><p>git pull Get and integrate remote changes</p><p>git push Upload local commits</p><p>git remote Manage remote repositories</p><p>git diff View differences</p><p>git restore Restore files/change working tree</p><p>git rm Remove tracked files</p><h3>36. git diff</h3><p>Suppose you changed:</p><pre>intprice=100;</pre><p>to:</p><pre>intprice=150;</pre><p>You can see the difference using:</p><pre>gitdiff</pre><p>Git can show:</p><pre>- int price = 100;<br>+ int price = 150;</pre><h3>37. git restore</h3><p>If you’ve changed a file but haven’t committed it and want to discard the working-tree change:</p><pre>git restore Main.java</pre><p>Be careful: this can discard your uncommitted changes.</p><h3>38. .gitignore</h3><p>Sometimes you <strong>don’t want Git to track certain files</strong>.</p><p>For example:</p><pre>node_modules/<br>*.class<br>.env<br>target/</pre><p>You can create:</p><pre>.gitignore</pre><p>Example:</p><pre>*.class<br>*.log<br>.env<br>target/</pre><p>Git will ignore matching files.</p><p>This is extremely important.</p><p>You generally shouldn’t commit things like:</p><pre>passwords<br>API keys<br>secret credentials<br>generated build files<br>large temporary files</pre><h3>39. Git configuration</h3><p>You usually configure your identity:</p><pre>git config--global user.name&quot;Your Name&quot;</pre><p>and:</p><pre>git config--global user.email&quot;you@example.com&quot;</pre><p>Check configuration:</p><pre>git config--list</pre><h3>40. Git’s three main local areas</h3><p>For exams, remember this diagram:</p><pre>┌─────────────────────┐<br>│  Working Directory  │<br>└──────────┬──────────┘<br>           │<br>        git add<br>           ↓<br>┌─────────────────────┐<br>│    Staging Area     │<br>└──────────┬──────────┘<br>           │<br>       git commit<br>           ↓<br>┌─────────────────────┐<br>│  Local Repository   │<br>└─────────────────────┘</pre><p>Then:</p><pre>Local Repository<br>       │<br>   git push<br>       ↓<br>┌─────────────────────┐<br>│ Remote Repository   │<br>│      GitHub         │<br>└─────────────────────┘</pre><h3>41. A complete example</h3><p>Imagine you want to create a Java project.</p><h3>Step 1 : Create project</h3><pre>mkdir StudentAppcd StudentApp</pre><h3>Step 2 : Initialize Git</h3><pre>git init</pre><h3>Step 3 : Create files</h3><pre>StudentApp/<br>├── Student.java<br>└── Main.java</pre><h3>Step 4 : Check status</h3><pre>git status</pre><p>Git might say:</p><pre>Untracked files:<br>    Main.java<br>    Student.java</pre><h3>Step 5 : Stage</h3><pre>git add .</pre><h3>Step 6 : Commit</h3><pre>git commit-m&quot;Initial project&quot;</pre><p>Now you have:</p><pre>Commit 1<br>&quot;Initial project&quot;</pre><h3>42. Make another change</h3><p>Modify:</p><pre>Student.java</pre><p>Then:</p><pre>git status</pre><p>You’ll see something like:</p><pre>modified: Student.java</pre><p>Stage:</p><pre>git add Student.java</pre><p>Commit:</p><pre>git commit-m&quot;Add student details&quot;</pre><p>Now:</p><pre>Commit 1<br>   ↓<br>Commit 2</pre><h3>43. Create a feature branch</h3><pre>git switch-c login</pre><p>Now:</p><pre>main<br>  \<br>   login</pre><p>Develop login functionality.</p><p>Then:</p><pre>git add .git commit-m&quot;Add login feature&quot;</pre><p>Switch back:</p><pre>git switch main</pre><p>Merge:</p><pre>git merge login</pre><p>Now the login changes are incorporated into main.</p><h3>44. Connect Git to GitHub</h3><p>Suppose you created an empty repository on GitHub.</p><p>You can add it as a remote:</p><pre>git remote add origin &lt;repository-url&gt;</pre><p>Then push:</p><pre>git push-u origin main</pre><p>The -u sets the upstream relationship, so future pushes can usually be simply:</p><pre>git push</pre><h3>45. GitHub workflow</h3><p>A typical team workflow looks like:</p><pre>GitHub<br>                   ↑<br>                 push<br>                   │<br>Developer → Local Git Repository<br>     ↑             │<br>     │           commit<br>     │             │<br>     └────── Working Directory</pre><p>For a team:</p><pre>                 GitHub<br>             /      |      \<br>            /       |       \<br>         Dev A    Dev B    Dev C<br>          ↓        ↓        ↓<br>        branch   branch   branch<br>           \       |       /<br>            \      |      /<br>                merge<br>                  ↓<br>                 main</pre><h3>46. Pull Requests</h3><p>When using GitHub, developers often don’t directly merge their branch into main.</p><p>Instead:</p><pre>feature branch<br>      ↓<br>    push<br>      ↓<br>   GitHub<br>      ↓<br>Pull Request<br>      ↓<br>Code Review<br>      ↓<br>Merge<br>      ↓<br>main</pre><p>A <strong>Pull Request (PR)</strong> is a request to merge changes from one branch into another.</p><p>For example:</p><pre>login-feature → main</pre><p>Team members can review the code before merging.</p><h3>47. Fork</h3><p>A <strong>fork</strong> is a copy of another person’s GitHub repository under your own GitHub account.</p><p>For example:</p><pre>Original repository<br>        ↓<br>       Fork<br>        ↓<br>Your GitHub repository</pre><p>This is particularly common in open-source projects.</p><p>You can modify your fork and submit a Pull Request to the original repository.</p><h3>48. Git tags</h3><p>A tag can identify a specific important point in repository history.</p><p>For example:</p><pre>v1.0<br>v1.1<br>v2.0</pre><p>Command:</p><pre>git tag v1.0</pre><p>Tags are commonly used for releases.</p><h3>49. Git HEAD</h3><p>You may encounter the term:</p><pre>HEAD</pre><p>HEAD generally refers to the commit/branch position you&#39;re currently working from.</p><p>For example:</p><pre>A → B → C<br>        ↑<br>       HEAD</pre><p>You’re currently at commit C.</p><p>If you switch branches:</p><pre>main:     A → B → C<br>                ↑<br>              HEAD</pre><pre>feature:  A → B → D</pre><p>HEAD moves with you.</p><h3>50. Git branch diagram</h3><p>Imagine:</p><pre>feature<br>                     ↓<br>A ─── B ─── C ───── D<br>      \<br>       E ─── F<br>             ↑<br>            main</pre><p>Branches allow different development histories to exist simultaneously.</p><p>Eventually they can be merged.</p><h3>51. Git is distributed</h3><p>This is one of the most important theoretical questions.</p><h3>Question:</h3><p><strong>Why is Git called a Distributed Version Control System?</strong></p><h3>Answer:</h3><p>Because each developer’s local Git repository contains the project’s version history, allowing many operations to be performed locally without requiring constant access to a central server.</p><h3>52. Advantages of Git</h3><h3>-Distributed</h3><p>Developers have local repositories.</p><h3>-Fast</h3><p>Many operations are performed locally.</p><h3>-Branching</h3><p>Branches are lightweight and useful for parallel development.</p><h3>-Collaboration</h3><p>Multiple developers can work on the same project.</p><h3>-History</h3><p>Complete project history can be maintained.</p><h3>-Offline work</h3><p>Many Git operations can be performed without Internet access.</p><h3>-Backup</h3><p>Remote repositories such as GitHub can provide another copy of the project.</p><h3>-Open source</h3><p>Git is free and open source.</p><h3>53. Disadvantages / challenges</h3><p>Git is powerful, but it can be confusing initially.</p><p>Common difficulties:</p><ul><li>Merge conflicts</li><li>Understanding branches</li><li>Accidentally committing unwanted files</li><li>Accidentally exposing secrets</li><li>Complex history manipulation</li><li>Learning the command-line interface</li></ul><p>For large binary files, ordinary Git can also become inefficient; teams may use tools such as Git LFS.</p><h3>54. Git vs traditional file saving</h3><h3>Without Git</h3><pre>project_v1<br>project_v2<br>project_final<br>project_final2<br>project_final_REAL</pre><h3>With Git</h3><pre>Commit 1<br>   ↓<br>Commit 2<br>   ↓<br>Commit 3<br>   ↓<br>Commit 4</pre><p>Git maintains the history systematically.</p><h3>55. The Git lifecycle</h3><p>This is a VERY useful exam diagram:</p><pre>Edit<br>               ↓<br>       ┌────────────────┐<br>       │ Working Tree   │<br>       └───────┬────────┘<br>               │<br>            git add<br>               ↓<br>       ┌────────────────┐<br>       │ Staging Area   │<br>       └───────┬────────┘<br>               │<br>          git commit<br>               ↓<br>       ┌────────────────┐<br>       │ Local Repo     │<br>       └───────┬────────┘<br>               │<br>           git push<br>               ↓<br>       ┌────────────────┐<br>       │ Remote Repo    │<br>       │    GitHub      │<br>       └────────────────┘</pre><p>And:</p><pre>Remote Repo<br>    ↓<br> git pull<br>    ↓<br>Local Repo<br>    ↓<br>Working Tree</pre><h3>56. The commands you should REALLY memorize</h3><p>If you’re learning Git for an exam or university, don’t try to memorize 100 commands.</p><p>Know these first:</p><pre>git initgit statusgit add .git commit-m&quot;message&quot;git loggit clone &lt;url&gt;git branchgit switch &lt;branch&gt;git switch-c &lt;branch&gt;git merge &lt;branch&gt;git remote-vgit pushgit pullgit fetchgitdiffgit restore</pre><p>And understand what each one <strong>does</strong>, rather than only memorizing the syntax.</p><h3>57. The BIG picture</h3><p>Put everything together:</p><pre>VERSION CONTROL<br>                           │<br>                           ↓<br>                         Git<br>                           │<br>              ┌────────────┴────────────┐<br>              ↓                         ↓<br>        Local Repository          Remote Repository<br>              │                         │<br>              │                       GitHub<br>              │<br>       ┌──────┴───────┐<br>       ↓              ↓<br> Working Tree     Staging Area<br>       │              │<br>       │           git add<br>       │              │<br>       └──────→ git commit<br>                      │<br>                      ↓<br>                Local History<br>                      │<br>                  git push<br>                      ↓<br>                    GitHub</pre><p>And for teamwork:</p><pre>GitHub<br>                    │<br>          ┌─────────┼─────────┐<br>          ↓         ↓         ↓<br>       Dev A      Dev B      Dev C<br>          │         │         │<br>       feature    feature    feature<br>       branch     branch     branch<br>          │         │         │<br>          └─────────┼─────────┘<br>                    ↓<br>              Pull Request<br>                    ↓<br>                Code Review<br>                    ↓<br>                  Merge<br>                    ↓<br>                  main</pre><h3>SOURCES:</h3><p><a href="https://www.atlassian.com/git/tutorials">https://www.atlassian.com/git/tutorials</a><br><a href="https://docs.github.com/en">https://docs.github.com/en</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=e7962c627017" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Definitions of Probability]]></title>
            <link>https://medium.com/@Heshani.y/definitions-of-probability-e2a5dba6a710?source=rss-1af0d3d60e51------2</link>
            <guid isPermaLink="false">https://medium.com/p/e2a5dba6a710</guid>
            <category><![CDATA[mathematics]]></category>
            <category><![CDATA[probability]]></category>
            <category><![CDATA[statistics]]></category>
            <dc:creator><![CDATA[Heshani Yapa]]></dc:creator>
            <pubDate>Sun, 08 Dec 2024 11:57:30 GMT</pubDate>
            <atom:updated>2024-12-08T11:57:30.152Z</atom:updated>
            <content:encoded><![CDATA[<p>Probability is more than mathematics, it’s our way of making sense of an unpredictable world. From weather forecasts to medical diagnoses, probability helps us understand and quantify uncertainty.</p><h4>1) The Classical Definition</h4><p>Pierre-Simon Laplace introduced a simple formula: probability equals favorable outcomes divided by total possible outcomes.</p><p><strong>Example:</strong> Rolling a 4 on a six-sided die has a 1/6 probability, which is straightforward for controlled scenarios like dice or coin flips.</p><h4>2) Empirical Probability</h4><p>Based on actual recorded data, empirical probability reflects the real-world occurrence of events. It calculates probability by analyzing historical or experimental observations.</p><p><strong>Example:</strong> Determining the probability of rain by examining 100 years of weather records in a specific location.</p><h4>3) Subjective Probability</h4><p>Introduced by Thomas Bayes, this definition treats probability as a measure of personal belief or confidence. It integrates available information, prior knowledge, and expert judgment.</p><p><strong>Example:</strong> A doctor estimates a patient’s likelihood of a condition by combining medical history, test results, and professional experience.</p><h4>4) Axiomatic Probability</h4><p>Andrey Kolmogorov established three fundamental axioms that define probability mathematically:</p><ol><li>Probability always ranges between 0 and 1 (cannot be negative either).</li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/444/1*YVts2hLDRvvCujhYw8KunQ.png" /></figure><p>2. The probability of the entire sample space is 1.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/169/1*xa3ZwRe3is-QdUA9HZM0QA.png" /></figure><p>3. Probabilities of mutually exclusive events can be added.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/373/1*PBe5wSAp6upiKuRu8snRCw.png" /></figure><p>or</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/709/1*IN_kctiQSyd9JACTemIdGQ.png" /></figure><h3>The Big Picture</h3><p>These definitions aren’t competing theories but complementary approaches. Each offers unique insights:</p><ul><li>Classical: Theoretical and idealized</li><li>Empirical: Data-driven and practical</li><li>Subjective: Incorporating personal knowledge</li><li>Axiomatic: Mathematically rigorous</li></ul><h3>Conclusion</h3><p>Probability is more than a simple calculation, it’s a sophisticated lens for understanding uncertainty in our complex world.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=e2a5dba6a710" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Global Fashion Ecosystem: Mapping the Industry Landscape]]></title>
            <link>https://medium.com/@Heshani.y/global-fashion-ecosystem-mapping-the-industry-landscape-8b2a7e2ffdcc?source=rss-1af0d3d60e51------2</link>
            <guid isPermaLink="false">https://medium.com/p/8b2a7e2ffdcc</guid>
            <category><![CDATA[fashion-industry]]></category>
            <category><![CDATA[haute-couture]]></category>
            <category><![CDATA[slow-fashion]]></category>
            <category><![CDATA[thrifting]]></category>
            <category><![CDATA[fashion]]></category>
            <dc:creator><![CDATA[Heshani Yapa]]></dc:creator>
            <pubDate>Sat, 30 Nov 2024 14:01:17 GMT</pubDate>
            <atom:updated>2024-11-30T14:01:17.012Z</atom:updated>
            <content:encoded><![CDATA[<p>Fashion is not just about trends, it’s a global phenomenon that intertwines art, culture, and commerce. This intricate ecosystem shapes how people express their identities and lifestyle choices, influencing economies and sparking innovation across the globe. From the streets of Paris to bustling trade fairs in Shanghai, the fashion industry thrives on its diversity and complexity.</p><h4>Market Sectors: Diverse Pillars of Fashion</h4><p>At the heart of the fashion ecosystem are its distinct market sectors, each contributing to the industry’s vibrant landscape:</p><ul><li><strong>Clothing and Apparel:</strong> The most visible segment, from casual wear to high-end couture, is catering to diverse styles and demographics.</li><li><strong>Accessories and Footwear:</strong> Essential complements to clothing, these items reflect individual expression, with shoes and bags often taking center stage in consumer preferences.</li><li><strong>Perfume and Cosmetics:</strong> The epitome of indulgence, these products blend luxury with everyday functionality, critical in shaping personal and cultural identities.</li><li><strong>Lifestyle and Homeware Products:</strong> Extending beyond personal style, this sector reflects the influence of fashion in interiors, from chic furniture to decorative items inspired by global trends.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*1tlRdTfQUtHoP-Er9e5m0g.jpeg" /><figcaption>Global fashion</figcaption></figure><h4>Market Levels: From Couture to Value Markets</h4><p>Fashion operates on multiple tiers, catering to various consumer bases:</p><ul><li><strong>Couture:</strong> The pinnacle of craftsmanship and exclusivity, characterized by bespoke designs and unparalleled artistry.</li><li><strong>Luxury:</strong> A blend of sophistication and brand heritage, targeting affluent consumers who value prestige and quality.</li><li><strong>Mid-Level:</strong> Bridging style and accessibility, this segment includes premium high-street brands that appeal to a broad audience.</li><li><strong>Mass Market or Value Market:</strong> The backbone of global fashion, this level offers affordable options that make style attainable for the majority.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*9Czp3ayIZJ72SVFQzPvTww.jpeg" /><figcaption>High Fashion</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/826/1*5OYET1syz9EWHTfSyophtw.jpeg" /><figcaption>Thrifting</figcaption></figure><h4>Fashion Capitals, Trade Fairs, and Stakeholders</h4><p>Certain cities are synonymous with fashion, serving as hubs for creativity and commerce. <strong>Paris</strong>, <strong>Milan</strong>, <strong>New York</strong>, and <strong>London</strong> dominate the landscape, setting trends and hosting iconic events like Fashion Week. Emerging cities like <strong>Tokyo</strong>, <strong>Seoul</strong>, and <strong>Shanghai</strong> are reshaping the global narrative with innovative designs and cultural influences.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*nfacNQ9HQP_m3aVnRsVHQA.jpeg" /><figcaption>From the Paris Fashion week Fall &amp; Winter 2024</figcaption></figure><p>Trade fairs such as <strong>Première Vision</strong> in Paris and <strong>Pitti Uomo</strong> in Florence are vital meeting points for industry stakeholders: designers, buyers, manufacturers, and retailers. These events unveil trends, foster collaborations, and drive the business side of fashion.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Oba51fuu0P5oIKrSQ5a_Zg.png" /><figcaption>From the Paris Men’s fashion week</figcaption></figure><p>The ecosystem is further enriched by diverse stakeholders, including <strong>designers</strong>, <strong>brands</strong>, <strong>retailers</strong>, <strong>sustainability advocates</strong>, and <strong>influencers</strong>, all playing crucial roles in defining and evolving the industry.</p><p>In an era where sustainability and technology are redefining boundaries, the global fashion ecosystem continues to evolve, balancing tradition with innovation. Understanding its structure and players is key to appreciating how this multifaceted industry impacts the world.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=8b2a7e2ffdcc" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[JDBC: Your Bridge to Databases in Java]]></title>
            <link>https://medium.com/@Heshani.y/jdbc-your-bridge-to-databases-in-java-7a2eb91c0c50?source=rss-1af0d3d60e51------2</link>
            <guid isPermaLink="false">https://medium.com/p/7a2eb91c0c50</guid>
            <category><![CDATA[programming]]></category>
            <category><![CDATA[computer-science]]></category>
            <category><![CDATA[coding]]></category>
            <category><![CDATA[jdbc]]></category>
            <category><![CDATA[java]]></category>
            <dc:creator><![CDATA[Heshani Yapa]]></dc:creator>
            <pubDate>Tue, 26 Nov 2024 21:47:25 GMT</pubDate>
            <atom:updated>2024-11-26T21:47:25.171Z</atom:updated>
            <content:encoded><![CDATA[<p>Ever wondered how Java applications talk to databases? Enter JDBC (Java Database Connectivity), the superhero of database connectivity in the Java world. Let’s break down this essential technology that powers countless Java applications.</p><h4>What is JDBC?</h4><p>JDBC is Java’s built-in database API that lets your Java code communicate with relational databases. Think of it as a universal translator between Java and various database languages. Whether you’re using MySQL, PostgreSQL, Oracle, or any other relational database, JDBC provides a consistent way to connect and interact.</p><h3>The Essential Steps:</h3><p><strong><em>1. Load the JDBC Driver</em></strong></p><p>Think of this as telling Java which type of database you’ll be working with. It’s like installing the right drivers for your printer:</p><pre>// The modern way (recommended)<br>Class.forName(&quot;com.mysql.cj.jdbc.Driver&quot;);<br><br>// Or for other popular databases:<br>// PostgreSQL: org.postgresql.Driver<br>// Oracle: oracle.jdbc.driver.OracleDriver<br>// SQL Server: com.microsoft.sqlserver.jdbc.SQLServerDriver</pre><p><strong><em>2. Create Connection</em></strong></p><p>Now we need to establish a connection to your database. Think of this as logging into your database account:</p><pre>String url = &quot;jdbc:mysql://localhost:3306/your_database&quot;;<br>String username = &quot;your_username&quot;;<br>String password = &quot;your_password&quot;;<br><br>Connection connection = DriverManager.getConnection(url, username, password);</pre><p><strong><em>3. Create Statement</em></strong></p><p>With our connection established, we need a way to write our SQL commands. JDBC offers three flavors of statements:</p><pre>// Simple Statement - for basic queries<br>Statement statement = connection.createStatement();<br><br>// PreparedStatement - for queries with parameters (prevents SQL injection)<br>PreparedStatement prepStatement = connection.prepareStatement(<br>    &quot;SELECT * FROM employees WHERE department = ?&quot;<br>);<br><br>// CallableStatement - for stored procedures<br>CallableStatement callStatement = connection.prepareCall(<br>    &quot;{call get_employee_by_id(?)}&quot;<br>);</pre><p><strong><em>4. Execute the Queries</em></strong></p><p>Time to actually interact with your database! You’ve got three main ways to do this:</p><pre>// For SELECT queries - returns ResultSet<br>ResultSet rs = statement.executeQuery(&quot;SELECT * FROM employees&quot;);<br>while (rs.next()) {<br>    String name = rs.getString(&quot;name&quot;);<br>    int age = rs.getInt(&quot;age&quot;);<br>    System.out.println(name + &quot; is &quot; + age + &quot; years old&quot;);<br>}<br><br>// For INSERT, UPDATE, DELETE - returns update count<br>int rowsAffected = statement.executeUpdate(<br>    &quot;UPDATE employees SET salary = 50000 WHERE department = &#39;IT&#39;&quot;<br>);<br><br>// Using PreparedStatement with parameters<br>prepStatement.setString(1, &quot;Engineering&quot;);<br>ResultSet rs = prepStatement.executeQuery();</pre><p><strong><em>5. Close the Connection</em></strong></p><p>Always clean up after yourself! Resources need to be closed in the reverse order they were opened:</p><pre>try (Connection connection = DriverManager.getConnection(url, username, password);<br>     Statement statement = connection.createStatement();<br>     ResultSet rs = statement.executeQuery(&quot;SELECT * FROM employees&quot;)) {<br>    <br>    // Your database operations here<br>    <br>} catch (SQLException e) {<br>    e.printStackTrace();<br>} // Resources automatically closed thanks to try-with-resources</pre><h4><strong>Putting It All Together:</strong></h4><p>Here’s a complete example that brings all these steps together:</p><pre>public class JDBCExample {<br>    public static void main(String[] args) {<br>        try {<br>            // Step 1: Register Driver<br>            Class.forName(&quot;com.mysql.cj.jdbc.Driver&quot;);<br>            <br>            // Step 2: Create Connection<br>            Connection connection = DriverManager.getConnection(<br>                &quot;jdbc:mysql://localhost:3306/company&quot;,<br>                &quot;username&quot;,<br>                &quot;password&quot;<br>            );<br>            <br>            // Step 3: Create Statement<br>            PreparedStatement pstmt = connection.prepareStatement(<br>                &quot;SELECT * FROM employees WHERE department = ?&quot;<br>            );<br>            <br>            // Step 4: Execute Query<br>            pstmt.setString(1, &quot;IT&quot;);<br>            ResultSet rs = pstmt.executeQuery();<br>            <br>            while (rs.next()) {<br>                System.out.println(&quot;Employee: &quot; + rs.getString(&quot;name&quot;));<br>            }<br>            <br>            // Step 5: Close Resources<br>            rs.close();<br>            pstmt.close();<br>            connection.close();<br>            <br>        } catch (Exception e) {<br>            e.printStackTrace();<br>        }<br>    }<br>}</pre><h4><strong>A few best practices to consider:</strong></h4><ul><li>Always use try-with-resources for automatic resource cleanup</li><li>PreparedStatement is preferred over Statement for security</li><li>Keep connection strings in configuration files</li><li>Use connection pooling in production applications</li><li>Handle SQLExceptions appropriately</li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=7a2eb91c0c50" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Exception Handling in Java: A Developer’s Guide]]></title>
            <link>https://medium.com/@Heshani.y/exception-handling-in-java-a-developers-guide-4b290f1ed2ed?source=rss-1af0d3d60e51------2</link>
            <guid isPermaLink="false">https://medium.com/p/4b290f1ed2ed</guid>
            <category><![CDATA[programming]]></category>
            <category><![CDATA[gui̇de]]></category>
            <category><![CDATA[computer-science]]></category>
            <category><![CDATA[development]]></category>
            <category><![CDATA[java]]></category>
            <dc:creator><![CDATA[Heshani Yapa]]></dc:creator>
            <pubDate>Mon, 25 Nov 2024 00:31:07 GMT</pubDate>
            <atom:updated>2024-11-25T00:31:07.176Z</atom:updated>
            <content:encoded><![CDATA[<p>When coding in Java, things don’t always go as planned. Files might be missing, network connections could fail, or that pesky array index might be out of bounds. This is where exception handling comes in, it’s your safety net for gracefully handling these unexpected situations.</p><h4>The Basics: Try-Catch Blocks</h4><p>The fundamental structure of exception handling in Java revolves around the try-catch block. Here’s how it works:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/808/1*61bV4lm3WJHZEzcy9FBqDg.png" /><figcaption>Try-catch block with multiple catch blocks</figcaption></figure><h4>The Finally Block: Your Cleanup Crew</h4><p>Sometimes you need to execute code regardless of whether an exception occurs. That’s where the<em> ‘finally’</em> block comes in:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/577/1*7sd2tAQ1pW0x3TwLDL2-rw.png" /><figcaption>try-catch block with finally block</figcaption></figure><h4>Throwing Your Own Exceptions</h4><p>Sometimes you’ll want to create custom exceptions. Java lets you do this by either:</p><ol><li>Throwing existing exceptions when you detect problems:</li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/755/1*xTeZrl7eGuZpsmFFWtl1Rg.png" /><figcaption>Throwing existing exceptions using ‘throw’ keyword</figcaption></figure><p>2. Creating your own exception classes:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/604/1*vqKadYVixmAk0rbxZmw9yg.png" /><figcaption>creating custom exceptions classes</figcaption></figure><p>Best Practices:</p><ul><li><em>Be specific with your exception handling</em></li><li><em>Don’t catch exceptions you can’t handle</em></li><li><em>Always clean up your resources</em></li><li><em>Use descriptive error messages</em></li><li><em>Consider using custom exceptions for domain-specific errors</em></li></ul><p>Remember, good exception handling isn’t about preventing all possible errors, it’s about handling them gracefully when they occur. Your future self (and colleagues) will thank you for writing robust, error-resistant code. :)</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=4b290f1ed2ed" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Basic Object-Oriented Programming Concepts in Java]]></title>
            <link>https://medium.com/@Heshani.y/basic-object-oriented-programming-concepts-in-java-cf2ae6f4c0c1?source=rss-1af0d3d60e51------2</link>
            <guid isPermaLink="false">https://medium.com/p/cf2ae6f4c0c1</guid>
            <dc:creator><![CDATA[Heshani Yapa]]></dc:creator>
            <pubDate>Sat, 27 Apr 2024 05:35:56 GMT</pubDate>
            <atom:updated>2024-04-27T05:37:48.918Z</atom:updated>
            <content:encoded><![CDATA[<h3>1) Object</h3><p>An object is a real-life entity. It has <strong>states</strong> (attributes/variables/data) and <strong>behaviors</strong> (methods/procedures/code that does something). In OOP an object is also an instance of a class.</p><h3>2) Class</h3><p>A class in OOP is a blueprint used to make objects.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/560/1*EH1BBpkm64DQU5BU1sMULg.gif" /><figcaption>Class and Object Explanation (Image source: Pinterest)</figcaption></figure><h3>3) Inheritance</h3><p>Inheritance happens when one class (<strong>child class</strong>/<strong>subclass</strong>) shares the states and behaviors defined by another class (<strong>parent class</strong>/<strong>superclass</strong>). Through inheritance, the subclass gets to reuse the code from the superclass (code reusability). It can also be used to achieve <strong>method overriding</strong> (<strong>runtime polymorphism</strong>).</p><p>There are 5 types of inheritance and Java supports 4 kinds of these inheritance types. (<strong>Interfaces</strong> achieve <strong>multiple inheritance</strong>.) The following diagram shows all 5 types of inheritance.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Yu4tT4bfw8un-GP7N4bAtg.jpeg" /><figcaption>Types of inheritance (source: Google search)</figcaption></figure><h4>Single inheritance</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/598/1*qfT4fD5e6IybS4fcIo9n4g.png" /><figcaption>Single Inheritance (source: Google search)</figcaption></figure><h4>Multi-level inheritance</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/757/1*rGezelBemdU1GuwJ5rFIkQ.png" /><figcaption>Multilevel inheritance (source: Google search)</figcaption></figure><h4>Hierarchical inheritance</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/862/1*fAhjT9FPhr9mUhQKPMbbOQ.png" /><figcaption>Hierarchical inheritance (source: Google search)</figcaption></figure><h4>Hybrid inheritance</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/882/1*DDFhdBpDp1bhc_cDciVNXw.png" /><figcaption>Hybrid inheritance (source: Google search)</figcaption></figure><h3>4) Polymorphism</h3><p>Polymorphic means having or occurring in several distinct forms. Polymorphism allows objects of different classes to be treated as objects of a common superclass.</p><p>Imagine you have classes for different shapes, such as <strong><em>‘Circle’</em></strong>, <strong><em>‘Square&#39;</em></strong>, and <strong><em>‘Triangle’</em></strong>, each with its own methods <strong><em>calculateArea()</em></strong><em> </em>and <strong><em>calculatePerimeter()</em>.</strong> Polymorphism allows you to treat objects of these shape classes as if they all belong to a common parent class, say <strong><em>‘Shape’</em></strong>.</p><p>Even though a <strong><em>‘Circle’ </em></strong>and a <strong><em>‘Square’ </em></strong>are different shapes, they can both be treated as <strong><em>‘Shape’ </em></strong>objects. This means you can write methods that work with <strong><em>‘Shape’ </em></strong>objects, and they&#39;ll automatically work with any of its subclasses (<strong><em>‘Circle’</em></strong>, <strong><em>‘Square’</em></strong>, <strong><em>‘Triangle’</em></strong>, etc.) without needing to know the specific type of shape.</p><p>There are 2 types of Polymorphism called, <strong>Runtime polymorphism</strong> (<strong>method overriding</strong>) and <strong>Compile-time polymorphism</strong> (<strong>method</strong> <strong>overloading</strong>).</p><h4>Method Overriding</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/429/1*ASLWX0NQ1dpXeTs-nFAcrg.png" /><figcaption>Method overriding (source: Google search)</figcaption></figure><h4>Method Overloading</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/393/1*fXpjhaZ1zv-AsZ_z_xNzyA.png" /><figcaption>Method overloading (source: Google search)</figcaption></figure><h3>5) Encapsulation</h3><p><strong>Encapsulation</strong> ensures that the internal implementation details of a class (such as variables) are hidden from external users. To achieve encapsulation, follow these steps:</p><ul><li>Declare class variables/attributes as <strong>private</strong>.</li><li>Provide <strong>public</strong> <strong><em>getter</em></strong> and <strong><em>setter</em></strong> methods to access and update the value of private variables.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*0Qz3Jggu24apblpmd9udaw.jpeg" /><figcaption>Encapsulation diagram (source: Google images)</figcaption></figure><ul><li>Private variables can only be accessed within the same class. However, by providing public getter and setter methods, you allow external classes to interact with these variables. (The <strong><em>get method</em></strong> returns the variable value, while the <strong><em>set method</em></strong> sets the value.)</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/657/1*kHyuuT8QDewsCX3mFZD2dw.png" /><figcaption>Example of how Getter and Setter methods work</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/922/1*3sC6VPEJL6q5l978D-RpHg.png" /><figcaption>Using the setter and getter methods in the main method</figcaption></figure><h3>6) Abstraction</h3><p><strong>Abstraction</strong> involves representing an object or system by emphasizing its essential features and ignoring less relevant details. It simplifies understanding and design by focusing on what an object does rather than how it accomplishes it. <br>The purpose of <strong>Abstraction</strong> is to achieve security by hiding certain details and showing only important information about an object.</p><p>In Java, abstraction can be achieved using <strong>abstract classes</strong> and <strong>abstract methods</strong>.</p><ul><li>An <strong>abstract class</strong> is a restricted class that cannot be directly used to create objects. To access it, you must inherit from another class.</li><li>An <strong>abstract method</strong> is a method declared in an abstract class without a body. The actual implementation is provided by the subclass that inherits from it.</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/477/1*A-5x-R2epmY0x7-Npyj_Pg.png" /><figcaption>Abstraction: Abstract class</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/640/1*EwOCVWU7Ui6TPFXvLNvKNA.png" /><figcaption>Abstraction: Subclass</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/763/1*EWFAacc4Me1TwQv37S2Thw.png" /><figcaption>Abstraction: <strong>Main method</strong></figcaption></figure><p>Abstraction can also be achieved using <strong>interfaces. </strong>An <strong>interface</strong> in Java is a fully abstract class. It defines a contract that other classes must follow by implementing the specified methods. Unlike abstract classes, interfaces support <strong>multiple inheritance</strong>, allowing a class to implement multiple interfaces.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/286/1*PiI3v0AbLyl7Qu3wlIjRuQ.png" /><figcaption><strong>Language</strong> interface with abstract methods <strong>getType()</strong> and <strong>getVersion()</strong></figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/499/1*E9w1WQUKojQmQi--C2YQTA.png" /><figcaption>Example implementation of an interface</figcaption></figure><h4>Difference between Abstract class and Interface</h4><ul><li>An abstract class can have both <strong>abstract methods</strong> (without implementation) and <strong>concrete methods</strong> (with implementation) and it supports <strong>single inheritance</strong> (extends only one class). Abstract class achieves <strong>partial abstraction</strong> (0 to 100%). Abstract classes are used when you want to provide a common base for related classes with shared behavior.</li><li>An interface contains only <strong>abstract methods</strong> (no method body) and it supports <strong>multiple inheritance</strong> (a class can implement multiple interfaces). Interface achieves <strong>full abstraction</strong> (100%). Interfaces are used when you want to define a contract that multiple unrelated classes can adhere to.</li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=cf2ae6f4c0c1" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Unveiling Talent: Rising Sri Lankan Designers  -  Chihiro Fernando]]></title>
            <link>https://medium.com/@Heshani.y/unveiling-talent-rising-sri-lankan-designers-chihiro-fernando-fb7cfe710a6f?source=rss-1af0d3d60e51------2</link>
            <guid isPermaLink="false">https://medium.com/p/fb7cfe710a6f</guid>
            <category><![CDATA[rising-designers]]></category>
            <category><![CDATA[fashion-design]]></category>
            <category><![CDATA[rising-design-talent]]></category>
            <category><![CDATA[sri-lanka]]></category>
            <category><![CDATA[south-asia]]></category>
            <dc:creator><![CDATA[Heshani Yapa]]></dc:creator>
            <pubDate>Thu, 22 Feb 2024 13:08:04 GMT</pubDate>
            <atom:updated>2026-01-19T00:03:07.375Z</atom:updated>
            <content:encoded><![CDATA[<h3>Unveiling Talent: Rising Sri Lankan Designers - Chihiro Fernando</h3><p>Meet Chihiro Fernando, a soulful and passionate advocate for all things art, fashion, and fabric design. In her latest collection, ‘Kala’, Chihiro unveils a breathtaking blend of Sri Lankan batik and Japanese Ukiyo-e art-inspired prints.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*IDIhDrHTOWyy9-IkPlSrHw.jpeg" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*WiwxyJd46Ll_RBZbNsLdQA.jpeg" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*M8Q3F4HQAc-lJ3l6FbFY6Q.jpeg" /><figcaption>Batik collection by Chihiro</figcaption></figure><p>Chihiro’s journey is one of passion and purpose. Rooted in the values of slow fashion, she champions sustainability at every turn. From her preference for sustainable silk to her commitment to the planet shines through in every thread. It’s a labor of love - a dedication to leaving the world a little brighter than she found it.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Zp55qDxchkuipzXJ5V-PGw.jpeg" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*DYHjnzKxJFaOMdu-UyyN0A.jpeg" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*rX4gbH0DIVb5LXX8uYVFRA.jpeg" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Obx43f0z5LtTykCcQrie2A.jpeg" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*EjyAufuZJcAV1diPU-ga8Q.jpeg" /><figcaption>‘Kala’ by Chihiro</figcaption></figure><p>Now, let’s talk about ‘Kala’. Inspired by the timeless beauty of the lotus flower and the vibrant hues of spring, Chihiro’s collection is a feast for the senses. Chihiro’s bold palette and intricate designs reflect her unwavering commitment to self-expression and individuality.</p><p>Chihiro’s dedication to sustainability shines through in every aspect of ‘Kala’. From her choice of sustainable silk to her materials, she leads by example, proving that fashion can be both beautiful and responsible. Through ‘Kala’, she invites us to explore the beauty in the world around us. After all, in Chihiro’s world, the true magic isn’t just in the fabric - it’s in the heart behind every creation.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*i3ppmOWlI7XwHrkNxW4HUg.png" /></figure><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=fb7cfe710a6f" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Unveiling Talent: Rising Sri Lankan Designers  - Shenith Weudagedara]]></title>
            <link>https://medium.com/@Heshani.y/unveiling-talent-rising-sri-lankan-designers-shenith-weudagedara-95d25cb99963?source=rss-1af0d3d60e51------2</link>
            <guid isPermaLink="false">https://medium.com/p/95d25cb99963</guid>
            <category><![CDATA[south-asia]]></category>
            <category><![CDATA[sri-lanka]]></category>
            <category><![CDATA[rising-design-talent]]></category>
            <category><![CDATA[rising-designers]]></category>
            <category><![CDATA[fashion-design]]></category>
            <dc:creator><![CDATA[Heshani Yapa]]></dc:creator>
            <pubDate>Wed, 21 Feb 2024 14:55:56 GMT</pubDate>
            <atom:updated>2026-01-19T00:02:05.253Z</atom:updated>
            <content:encoded><![CDATA[<h3>Unveiling Talent: Rising Sri Lankan Designers - Shenith Weudagedara</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*DwuNAv6oG-spzugSwqQqBw.jpeg" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*KuEsbZ2vLdEqtmz8VvdATQ.jpeg" /><figcaption>Shenith Weudagedara</figcaption></figure><p>Meet Shenith, a rising star in the vibrant world of Sri Lankan fashion. Hailing from Negombo Sri Lanka, Shenith, at 19, is a fashion design student and performance artist whose creative endeavors are making waves in the local fashion scene, one project at a time.</p><p>Inspired by his grandmother, who was renowned in their community for her skill in crafting clothes and intricate saree jackets, Shenith’s journey into the world of fashion began at a young age. He fondly recalls watching his grandmother create and mend garments, especially during festive occasions like Christmas and Easter times. Her talent ignited a passion within Shenith for all things related to creating clothing. <br>Drawing from his upbringing and his grandmother’s influence, Shenith’s early ventures into fashion involved repurposing his mother’s old sarees and dresses. These humble beginnings laid the foundation for his innovative approach to design, which prioritizes recycling and sustainability.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*hjet4hW4OIG5s_UwQCUmYg.jpeg" /><figcaption>Shenith’s creations</figcaption></figure><p>Currently, Shenith is deeply engaged in repurposing eco friendly denim, experimenting with techniques like bleaching and patchwork, while also incorporating local craft fabrics and organic materials like linen into his designs. His creations, infused with a modern sensibility, reflect his understanding of the Sri Lankan climate and his desire to cater to the tastes of the local young audience.<br>Spring and summer are Shenith’s primary seasons of focus, as he feels more attuned to the warm, tropical climate of Sri Lanka during these times. This familiarity allows him to craft pieces that resonate deeply with his clientele, capturing the essence of the season in every stitch and silhouette.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*z2_4YWNd3BeicBf1w1AA0Q.jpeg" /><figcaption>Experimentation with recycled materials and eco-friendly fabrics</figcaption></figure><p>When it comes to color palettes, Shenith prefers monochromatic hues, pastels, muted tones, and whites, reflecting his signature “grandpacore” aesthetic - a comfortable, vintage-inspired style that exudes timeless elegance.</p><p>In Shenith’s world, fashion is more than just clothing; it’s a form of self-expression, storytelling, and sustainability. His work is a testament to the contemporary use of Sri Lankan culture and heritage.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/900/1*i3jFFahNss0L9WLldANk7A.jpeg" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*4k1rENQW_C_EoKfXDEBuBA.jpeg" /><figcaption>Drawings done by Shenith</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*WaiUrLvm2Bj3-zoW0Xrmtw.jpeg" /><figcaption>A collection done by Shenith</figcaption></figure><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=95d25cb99963" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[The dying craft of Kandyan Weave]]></title>
            <link>https://medium.com/@Heshani.y/the-dying-craft-of-kandyan-weave-7dbc9ec9d144?source=rss-1af0d3d60e51------2</link>
            <guid isPermaLink="false">https://medium.com/p/7dbc9ec9d144</guid>
            <dc:creator><![CDATA[Heshani Yapa]]></dc:creator>
            <pubDate>Sun, 18 Feb 2024 09:11:20 GMT</pubDate>
            <atom:updated>2024-02-22T04:55:13.449Z</atom:updated>
            <content:encoded><![CDATA[<p>Surrounding the lush hills and the rich cultural fabric of Sri Lanka is a tradition as intricate and diverse as the very land — the art of Kandyan weave. For years, the skillful craftsmen have been undergoing this precise process of creating the detailed motifs that carry the stories, culture and traditions. Although the fabric of Kandyan weave is of great cultural value, the art is facing an uncertain future, being challenged by modernization, market demand, and declining interest among the youth.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*WbLW2V_x3f-r-Pujvr99NQ.jpeg" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*hJUqlw4JL8FlBpw-GUGCRA.png" /><figcaption>Tropical hills of Kandy (pictures from Freepik)</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/597/1*mhoa4fze5VQNsuiEJLGQ3A.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/945/1*FqC-7_Icd7ICK_aG7BPXvA.png" /><figcaption>Weaving artisans’ workshop (pictures from Freepik)</figcaption></figure><h4><strong>The Vanishing Artisan</strong></h4><p>The declining trend of Kandyan weave in people’s minds is very evident, although it has passed many years successfully. The major reason for its decline is modernization and cost-effective machines, which make the craft less attractive to new generations and prevents them from practicing this traditional craft. The very rapid modernization of Sri Lanka represents a major challenge to the younger generation, who are increasingly mesmerized by urban lifestyles and modern careers and depart from the tribal occupations of their ancestors.</p><h4>Decreasing consumer interest</h4><p>Besides, the economic problems arising from the artisans further worsen the problem. The decreasing market for handwoven fabrics that face the twin ills of rising costs of production and competition from cheaper machine made cotton has made it difficult for Kandyan weavers to sustain their craft as a viable means of sustenance.</p><h4>Preserving the Tradition Against the Modern Way of Life</h4><p>While weaving is being challenged, there are initiatives to secure the heritage of this art form and its weavers. Organizations, NGOs and programs supported by the government work together to offer training, money support and market access to artisans, which enables them to continuously practice their tradition in the world that is constantly changing.</p><h4>Reviving the Craft: The Call to Action</h4><p>While the challenges the industry of Kandyan weave is facing are substantial, it is not in vain. Also, there are now many projects to educate the public on the cultural values of Kandyan weave are launched. Efforts to present this rich and complex art form in exhibitions, workshops, and educational programs have been made to re-introduce it not only to local but also to the audience around the world, thus, stimulating the renewed interest and appreciation for this traditional art.</p><p>Kandyan weave craft does face a lot of difficulties but they are not hopeless. We need to acknowledge the significance of cultural heritage conservation and helping artisans pass on the traditions. As consumers, we can make a difference by purchasing ethically made, handcrafted articles which preserve heritage.</p><p>Apart from individuals and craftsmanship enthusiasts, governments, policymakers, and other stakeholders should also do their share by forming the policy, providing funds for artisan communities, and creating platforms for promotion and conservation of traditional crafts.</p><p>In the world where mainstream production is the priority, crafts like Kandyan weave are the reminder of the heritage, craftsmanship, and the cultural identity. Together we can keep the intricate mosaic of heritage alive just as the magic of it is experienced by the generations to come. All the beauty of Kandyan weave is a reflection of the strength of the human spirit, and genuine art that has the ability to outlast time and space.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=7dbc9ec9d144" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>