<?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 Roshana Perera on Medium]]></title>
        <description><![CDATA[Stories by Roshana Perera on Medium]]></description>
        <link>https://medium.com/@mkroshana?source=rss-e02a7abfc10d------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/0*hpmORRxdExsHfHnq</url>
            <title>Stories by Roshana Perera on Medium</title>
            <link>https://medium.com/@mkroshana?source=rss-e02a7abfc10d------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sat, 05 Dec 2026 09:29:50 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@mkroshana/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[What’s inside the JVM ? How it works ?]]></title>
            <link>https://mkroshana.medium.com/whats-inside-the-jvm-how-it-works-738d77c965e7?source=rss-e02a7abfc10d------2</link>
            <guid isPermaLink="false">https://medium.com/p/738d77c965e7</guid>
            <dc:creator><![CDATA[Roshana Perera]]></dc:creator>
            <pubDate>Tue, 06 Dec 2022 07:30:51 GMT</pubDate>
            <atom:updated>2022-12-06T07:30:51.438Z</atom:updated>
            <content:encoded><![CDATA[<h3>What’s inside the JVM? How it works?</h3><p>A deep dive into the Java Virtual Machine and how the JVM works explained briefly.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*iK1EFamgj6pjOvuhROEFNA.jpeg" /></figure><p>Before talking about the Java Virtual Machine (JVM), I will give a brief introduction on Virtual Machines.</p><p><strong>What is a Virtual Machine (VM) ?</strong></p><p>A virtual environment that functions as a real computer with its own resources, created on a physical hardware system is called a Virtual Machine (VM). Virtualization technologies allows sharing a single system with many virtual environments.</p><p>The Java Virtual Machine (JVM) is a software platform that enables programs written in the Java programming language to run on a wide range of devices and operating systems. The JVM is designed to be a virtual “execution engine” that interprets and executes Java bytecode, which is the compiled form of a Java program.</p><p>The JVM is composed of several different components that work together to provide the execution environment for Java programs. These components include the class loader, which loads the compiled classes of a Java program into the JVM; the memory area, which manages the allocation and deallocation of memory for the program; the execution engine, which interprets and executes the Java bytecode instructions; and the runtime data area, which stores the data and objects used by the program during execution.</p><p>The JVM also includes several other components and subsystems that support the execution of Java programs, such as the garbage collector, which manages the memory allocation and deallocation of objects to prevent memory leaks; the thread scheduler, which manages the execution of concurrent threads in a Java program; and the security manager, which enforces security policies to prevent unauthorized access to system resources.</p><p>Overall, the JVM is a complex and sophisticated software platform that provides a powerful and flexible execution environment for Java programs. It enables Java programs to run on a wide range of devices and operating systems, and supports a wide range of features and capabilities to support the execution of complex and demanding applications.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=738d77c965e7" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Evolution of Iron Man suite]]></title>
            <link>https://mkroshana.medium.com/evolution-of-iron-man-suite-ba46d4eccdd3?source=rss-e02a7abfc10d------2</link>
            <guid isPermaLink="false">https://medium.com/p/ba46d4eccdd3</guid>
            <category><![CDATA[iron-man-suit]]></category>
            <dc:creator><![CDATA[Roshana Perera]]></dc:creator>
            <pubDate>Tue, 06 Dec 2022 07:28:21 GMT</pubDate>
            <atom:updated>2022-12-06T07:28:41.720Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*H-i6MF2fhbRmBw-BPPDLug.png" /></figure><p>The Iron Man suit, also known as the Mark XLVII, is a high-tech suit of armor developed by the genius inventor Tony Stark. The suit is designed to provide its wearer with superhuman strength, speed, and durability, as well as a wide range of advanced technology and weapons systems.</p><p>The Iron Man suit has undergone numerous changes and upgrades over the years, as Tony Stark continues to improve and refine the technology behind it. The original Iron Man suit, the Mark I, was developed as a crude exoskeleton suit of armor made from scrap metal and powered by a miniature arc reactor. This suit allowed Tony Stark to escape captivity and defeat his captors, but it was bulky and unwieldy, and lacked many of the advanced features of later models.</p><p>The subsequent Mark II, Mark III, and Mark IV suits were developed to be more compact and agile, and featured improved flight capabilities, weapons systems, and armor plating. The Mark V suit, also known as the “Suitcase Suit,” was designed to be portable and easily deployable, allowing Tony Stark to summon and don the suit quickly in any situation.</p><p>The Mark VI, Mark VII, and Mark VIII suits were developed to incorporate new materials and technologies, such as advanced vibranium-based armor plating and repulsor technology, as well as more advanced weapons systems and enhanced flight capabilities. The Mark IX and Mark X suits were designed for space travel and deep-sea exploration, and featured specialized armor and technology to allow their wearers to operate in extreme environments.</p><p>The latest model of the Iron Man suit, the Mark XLVII, is the most advanced and powerful suit yet developed. It features advanced artificial intelligence, enhanced armor plating, and a wide range of new weapons systems, as well as the ability to transform into multiple different configurations to adapt to different combat situations.</p><p>Overall, the evolution of the Iron Man suit has been a remarkable journey, from the crude, makeshift Mark I suit to the advanced, versatile Mark XLVII suit of today. With each new model, Tony Stark has pushed the boundaries of technology and engineering, creating a suit of armor that is truly a marvel of modern science.</p><p>(this was written by ChatGPT from OpenAI)</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=ba46d4eccdd3" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[What is JDK, JRE & JVM ?]]></title>
            <link>https://mkroshana.medium.com/what-is-jdk-jre-jvm-ef5a6b609cf2?source=rss-e02a7abfc10d------2</link>
            <guid isPermaLink="false">https://medium.com/p/ef5a6b609cf2</guid>
            <category><![CDATA[jdk]]></category>
            <category><![CDATA[jre]]></category>
            <category><![CDATA[jvm]]></category>
            <category><![CDATA[java]]></category>
            <category><![CDATA[compilers]]></category>
            <dc:creator><![CDATA[Roshana Perera]]></dc:creator>
            <pubDate>Mon, 07 Mar 2022 11:16:00 GMT</pubDate>
            <atom:updated>2022-03-07T11:16:00.565Z</atom:updated>
            <content:encoded><![CDATA[<h3>What is JDK, JRE &amp; JVM ?</h3><p>Brief explanation of differences of JVM, JDK, JRE and what does they do.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/799/1*8qI8gG5u4GU5mrcfWBr1ag.png" /></figure><p>Java is an object oriented high-level programming language. To develop, test or run Java code on a device at least one of JDK, JRE or JVM is required. Most newer developers confuses the Java Development Kit (JDK) and the Java Runtime Environment (JRE). Let’s explore each of these individually.</p><p><strong>JDK (Java Development Kit)</strong></p><p>The Java Development Kit (JDK) is one of the core components used in Java programming, along with Java Virtual Machine (JVM) and Java Runtime Environment (JRE). The Java Development Kit is a package of tools that is used to develop Java programs. Every JDK contains a compiler which converts raw “.java” files into executable “.class” files.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*3sK47VBzR72uiKncrjUr4A.jpeg" /><figcaption>High-Level view of the JDK (source: infoworld.com)</figcaption></figure><p>JRE (Java Runtime Environment)</p><p>The Java Runtime Environment (JRE) is a package of tools that is used for running Java code. To just run Java programs, JRE can be used as a standalone component. JRE is also a part of JDK and is required in JDK because running your code is part of the development. JRE is tightly platform dependent. Which means if you install JRE on Windows machine it will install necessary code and tools that is necessary for running Java programs on Windows machine. Likewise if it’s a Mac, it install Mac compatible code and tools. It is a software layer that runs on top of a computer’s operating system, providing additional services specific to Java which allows Java programs to run. JRE also contains the JVM (Java Virtual Machine).</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*EeTJP4czwlEVE6eFqs-1iw.jpeg" /><figcaption>High-Level view of the JRE (source: ictacademy.com.ng)</figcaption></figure><p>JVM (Java Virtual Machine)</p><p>Java Virtual Machine (JVM) is a specification that is needed to run Java programs, which comes with Java Runtime Environment (JRE). In other programming languages, the compiler creates a machine code for a particular system. However, Java compiler produces code specifically for the JVM. The JVM can read the “.class” file created by the compiler. It converts the class file to a language that the operating system can understand. The JVM runs only when you execute a code. After exiting the Java program, the JVM will also stop.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/837/1*kYat214qhdPMpcWf4_1ZPg.png" /><figcaption>How JVM works (source: educba.com)</figcaption></figure><p>In a future article I will be diving deep into how the JVM works, as I barely scratch the surface of how the JVM works.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=ef5a6b609cf2" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Why java.util.date & java.sql.date both still exists and being used today ?]]></title>
            <link>https://mkroshana.medium.com/why-java-util-date-java-sql-date-both-still-exists-and-being-used-today-3e83025997af?source=rss-e02a7abfc10d------2</link>
            <guid isPermaLink="false">https://medium.com/p/3e83025997af</guid>
            <category><![CDATA[java-date-time]]></category>
            <category><![CDATA[java]]></category>
            <category><![CDATA[software-development]]></category>
            <category><![CDATA[java-time]]></category>
            <dc:creator><![CDATA[Roshana Perera]]></dc:creator>
            <pubDate>Tue, 01 Feb 2022 14:28:07 GMT</pubDate>
            <atom:updated>2022-02-01T14:28:07.957Z</atom:updated>
            <content:encoded><![CDATA[<h3>Why java.util.date &amp; java.sql.date both still exists and being used today ?</h3><p><strong>Brief explanation of both and why you shouldn’t be using these and what should you use.</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/500/1*rHRiCY8TkYOxtooHTxSpsg.png" /></figure><p>Since the existent of using date and time in Java, java.util.date was the go to class for using date and time related functions in Java. With the release of Java 8 in 2014 which had a lot of improvements, a new API was introduced for date and time. This is also known as JSR-10 specification which is for the new and improved date and time API.</p><p>Before going any further, I would explain what is java.util.date and java.util.sql and uses of those.</p><h3>java.util.date</h3><p>First of all the java.util.date is kind of misleading as it not only represents the date but also represents the time. In broader terms, java.util.date represents an <strong>instant in time.</strong></p><blockquote><strong>Instant in time</strong> is a concept that could be used to identify when something happened which could be in the past, present or future. This concept is independent of time zones and calendar systems. It’s independent as people in different places in the world use their local time representations in their areas so this could be talk about in different ways.</blockquote><p>The java.util.date class represents the time with millisecond precision since <strong>EPOCH time</strong> (1st of January, 1970 00:00:00 GMT).</p><blockquote><strong>EPOCH time</strong>, also known as The UNIX EPOCH is the number of seconds that have elapsed since the 1st of January, 1970 midnight (UTC/GMT) but not counting leap seconds. In UNIX EPOCH time every single day is treated as it has exactly 86,400 seconds with no seconds added to or subtracted from the day as a result of positive or negative leap seconds. Due to this, UNIX EPOCH time isn’t an accurate representation of UTC/GMT time.</blockquote><p>There are so many flaws with java.util.date. It doesn’t have time zone, a format, a calendar system and the list goes on. Because of those flaws, so much of java.util.date was deprecated in Java 1.1 in 1997 but are still being used to this date unfortunately.</p><h3>java.sql.date</h3><p>The java.sql.date is a subclass that is used to represent SQL DATE which consists only years, month and days without associating with a time zone. No time data is kept in java.sql.date. Even though no time data is kept in java.sql.date the date is stored in milliseconds since the UNIX EPOCH time and the time part is set to zero as it is basically a wrapper around java.util.date that only handles SQL specific requirements.</p><p>There’s also java.sql.time which is also another subclass that represents SQL TIME and only contains information about hour, minutes, seconds and milliseconds and the date part is set to zero.</p><h3>Why you shouldn’t use those ?</h3><p>There are a lot of reasons why you shouldn’t be using these. Apart from the ones I’ve mentioned previously these are some of the main flaws; months are indexed from zero which has led to many off-by-one errors, date and time are mutable and to mitigate that when you need to retrieve it you need to return a clone as it is mutable, most of the places it uses the system local time zone including toString(), methods are named like getDate() returns the day-of-month and getDay() returns the day-of-week, seconds arerepresented by an integer from 0 to 61 are to name some. Because of the mentioned reasons and a plethora of other reasons you shouldn’t be using these.</p><p>If you are not in a Java 8 or later version you can use JODA time which is a replacement for the old Java date and time classes. It mitigates most of the mentioned issues and flaws and more. If for some reason you really needed to use old date and time classes try to avoid the deprecated classes cause most of them are deprecated for nearly 20 years and if you really want to use deprecated classes, make sure you really understand them before implementing them.</p><h3>What should you use ?</h3><p>In order to address those problems in 2014 Java 8 was introduced which had a lot of improvements and a new API for date and time which is free of those problems. The new Date and Time API is moved to <strong>java.time</strong> package. Also, the JODA time format is followed in the new API. All the classes are immutable and can hold time zone and calendar data.</p><p>Handling dates and times are tricky. We need to remember about special cases like leap seconds, different time zones &amp; etc. When dealing with a database we can use java.sql.date with caution. If we’re going to use java.util.date, we need to remember about its shortcomings. If you are using Java 8 or a later version do not to use java.util.date at all. Instead use java.time.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=3e83025997af" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>