<?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: Dayo</title>
    <description>The latest articles on DEV Community by Dayo (@osborne).</description>
    <link>https://dev.to/osborne</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%2F1211760%2Fa882bb51-00a4-4c98-abb0-ebbf8e303d40.jpg</url>
      <title>DEV Community: Dayo</title>
      <link>https://dev.to/osborne</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/osborne"/>
    <language>en</language>
    <item>
      <title>Type Conversion and Casting</title>
      <dc:creator>Dayo</dc:creator>
      <pubDate>Fri, 01 Dec 2023 23:01:42 +0000</pubDate>
      <link>https://dev.to/osborne/type-conversion-and-casting-844</link>
      <guid>https://dev.to/osborne/type-conversion-and-casting-844</guid>
      <description>&lt;p&gt;Type casting is the process of converting a variable from one data type to another. In Java, which is a statically-typed language, variables have a specific type, and type casting allows you to change a variable’s type under certain conditions.&lt;/p&gt;

&lt;p&gt;In Java, numeric values are typically stored using data types such as int, long, byte, double, and float. Character values are stored using String, char, and boolean for boolean values (true or false).&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Implicit Conversion&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Implicit or automatic conversion occurs when two conditions are met:&lt;/p&gt;

&lt;p&gt;the two types are compatible, &lt;/p&gt;

&lt;p&gt;the destination type is larger than the source. &lt;/p&gt;

&lt;p&gt;For example, converting from a byte to a long is implicitly done by Java because the long type is large enough to hold all values of a byte. This is also known as widening conversion.&lt;/p&gt;

&lt;p&gt;However, implicit conversion has drawbacks. For instance, if an operation results in a value that cannot be accommodated by the destination type, a compile-time error occurs.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Explicit Conversion&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;On the other hand, explicit conversion occurs when the destination type is smaller than the source type. For example, if a long value is being assigned to an int variable, explicit conversion is required. This is also known as narrowing conversion and is done using type casting with the general form: &lt;code&gt;(target type) value&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Type Promotion Rules&lt;/strong&gt;&lt;br&gt;
Type promotion rules dictate the promotion of data types when performing operations. First, byte, short, and char values are promoted to int. If one operand is a long, the entire expression is promoted to long. If one operand is a float, the entire expression is promoted to float. If any operand is double, the result is double. These rules help ensure consistent and predictable behaviour during operations involving different data types.&lt;/p&gt;

</description>
    </item>
    <item>
      <title>Understanding the Basics of Variables and Data Processing in Java</title>
      <dc:creator>Dayo</dc:creator>
      <pubDate>Thu, 23 Nov 2023 22:04:08 +0000</pubDate>
      <link>https://dev.to/osborne/understanding-the-basics-of-variables-and-data-processing-in-java-cd7</link>
      <guid>https://dev.to/osborne/understanding-the-basics-of-variables-and-data-processing-in-java-cd7</guid>
      <description>&lt;p&gt;In the world of software development, the primary goal is to solve real-world problems. The transition from real-world challenges to virtual solutions has become seamless, evident in services like Amazon for online shopping and Uber for convenient transportation. As we delve into the virtual realm, one crucial element takes the  centre stage is data.&lt;/p&gt;

&lt;p&gt;Data forms the backbone of software applications. Whether it's user inputs or processed information, handling data efficiently is essential. The key player in this process is the database, providing a permanent storage solution for information.&lt;/p&gt;

&lt;p&gt;In Java, the fundamental concept is the "variable." Think of a variable as a box that can store different types of data, such as numbers, text, images, or videos. Each variable has a specific type associated with it, like ‘int’ for integers or “String” for text.&lt;/p&gt;

&lt;p&gt;Let's break down the basic steps:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;1. Storing Data:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;To store data, you declare a variable by specifying its type, giving it a name, and assigning a value.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--h9REg24n--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/tvf7jw8gyr13enrkrkqo.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--h9REg24n--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/tvf7jw8gyr13enrkrkqo.png" alt="Image description" width="800" height="175"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;2. Processing Data:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Once data is stored, you can perform various operations on it. In Java, you use the assignment operator (‘=’) to assign values and perform operations.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--M1XDDok_--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/ri4hjkhle54vb7lz8mm5.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--M1XDDok_--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/ri4hjkhle54vb7lz8mm5.png" alt="Image description" width="800" height="143"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;3. Printing Results:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;To observe the results, you can use the ‘System.out.println’ statement. For a new line, you can use ‘System.out.println();’.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--BrIym1Ch--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/abcc3tcj7jlii91auhzp.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--BrIym1Ch--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/abcc3tcj7jlii91auhzp.png" alt="Image description" width="800" height="59"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;** 4. Compilation and Execution:**&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;After making changes, it's essential to compile the code before running it.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--AaCOv2R4--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/v4xrzmykpv8w4t7w1sxu.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--AaCOv2R4--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/v4xrzmykpv8w4t7w1sxu.png" alt="Image description" width="800" height="144"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;By understanding the basics of variables and data processing in Java, you lay the foundation for building more complex and functional applications. This knowledge empowers you to solve a myriad of real-world problems by harnessing the power of the virtual world.&lt;/p&gt;

</description>
      <category>java</category>
      <category>webdev</category>
      <category>programming</category>
      <category>api</category>
    </item>
    <item>
      <title>Understanding How Java Code Runs Behind the Scenes</title>
      <dc:creator>Dayo</dc:creator>
      <pubDate>Wed, 22 Nov 2023 10:16:24 +0000</pubDate>
      <link>https://dev.to/osborne/understanding-how-java-code-runs-behind-the-scenes-67g</link>
      <guid>https://dev.to/osborne/understanding-how-java-code-runs-behind-the-scenes-67g</guid>
      <description>&lt;p&gt;Java, known for its platform independence, relies on the Java Virtual Machine (JVM) to execute code. Whether you're using Windows, Linux, or Mac, as long as you have JVM installed, you can run Java applications.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;The Java Execution Process&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;1.&lt;strong&gt;Hardware and Operating System (OS)&lt;/strong&gt;:Your machine has hardware, and on top of that, there's an operating system.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Java Virtual Machine (JVM)&lt;/strong&gt;: Installed on your machine, the JVM is essential for running Java applications. However, it is platform-dependent, meaning it needs to be built for a specific OS.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Compilation&lt;/strong&gt;: When you write Java code, you don't give it directly to the JVM. Instead, you use a Java compiler (Java C) to convert the human-readable code into bytecode, an unreadable format for humans.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Bytecode&lt;/strong&gt;: Bytecode is what JVM understands. It serves as an intermediary between your code and the JVM.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Main Method&lt;/strong&gt;: Your Java file needs a special method called &lt;code&gt;main&lt;/code&gt; with a specific signature. This is the entry point for JVM execution.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Class&lt;/strong&gt;: Java is object-oriented, so you need a class. &lt;/p&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;7.** Code Execution**: After compilation, the code becomes bytecode. When you run it with the Java command, specifying the class name, the JVM executes it.&lt;/p&gt;

&lt;h2&gt;
  
  
  Object-Oriented Nature
&lt;/h2&gt;

&lt;p&gt;Java follows an object-oriented paradigm, where everything revolves around objects. To create objects, you need classes. So, make sure to include a class in your Java code.&lt;/p&gt;

&lt;h2&gt;
  
  
  Java Development Kit (JDK) and Java Runtime Environment (JRE)
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;JDK (Java Development Kit)&lt;/strong&gt;: Developers use the JDK during development. It includes the JVM, libraries, and additional resources.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;JRE (Java Runtime Environment)&lt;/strong&gt;: When running Java applications on other machines, only JRE is needed. It consists of JVM and essential libraries.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Write Once, Run Anywhere&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Java's tagline, "&lt;em&gt;&lt;strong&gt;Write once, run anywhere&lt;/strong&gt;&lt;/em&gt;," signifies its ability to create code on one machine and run it on any other machine with Java and JVM installed. The JDK is exclusive to development, making Java versatile and accessible.&lt;/p&gt;

&lt;p&gt;Understanding this behind-the-scenes process is crucial for Java developers. It clarifies the role of JVM, the importance of bytecode, and the significance of the main method. As we delve deeper into Java development, these fundamentals will become second nature.&lt;/p&gt;

</description>
      <category>java</category>
      <category>virtualmachine</category>
      <category>beginners</category>
      <category>softwareengineering</category>
    </item>
    <item>
      <title>Introduction to Java Programming</title>
      <dc:creator>Dayo</dc:creator>
      <pubDate>Tue, 21 Nov 2023 19:53:34 +0000</pubDate>
      <link>https://dev.to/osborne/introduction-to-java-programming-56f6</link>
      <guid>https://dev.to/osborne/introduction-to-java-programming-56f6</guid>
      <description>&lt;p&gt;Welcome to the exciting world of Java programming! If you're eager to write your first Java code, you're in the right place. Before diving into the code, let's set up our development environment.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Setting Up the Environment&lt;/strong&gt;&lt;br&gt;
You need a place to write your code, and while you can use a simple text editor like Notepad, using an Integrated Development Environment (IDE) offers a more powerful development experience. Popular Java IDEs include:&lt;/p&gt;

&lt;p&gt;Netbeans&lt;/p&gt;

&lt;p&gt;Eclipse&lt;/p&gt;

&lt;p&gt;Visual Studio Code&lt;/p&gt;

&lt;p&gt;IntelliJ&lt;/p&gt;

&lt;p&gt;Choose one that suits your preferences, as each comes with its unique features for coding, running, compiling, and debugging Java programs.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Java Development Kit (JDK)&lt;/strong&gt;&lt;br&gt;
To run Java code on your chosen IDE, you'll need the Java Development Kit (JDK). The JDK is a comprehensive software development kit for building Java applications. It includes:&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Java Runtime Environment (JRE)&lt;/strong&gt;: Executes Java programs.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Interpreter/Loader (java)&lt;/strong&gt;:Interprets and loads Java bytecode.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Compiler (javac)&lt;/strong&gt;: Translates Java source code into bytecode.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Archiver (jar)&lt;/strong&gt;: Packages compiled Java code into JAR files.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Documentation Generator (javadoc)&lt;/strong&gt;: Creates documentation from Java source code.&lt;/p&gt;

&lt;p&gt;Ensure you have the latest JDK version by checking the official Oracle or OpenJDK website. While new features are added with each release (Java 21 being the latest at the time of writing), Java maintains backward compatibility. The basic language features remain consistent across versions.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;JDK Versions and Long-Term Support (LTS)&lt;/strong&gt;&lt;br&gt;
Not all JDK versions receive Long-Term Support. Some notable versions with LTS include Java SE 8, 11, and 17. These versions receive extended support and updates, ensuring stability for critical applications.&lt;/p&gt;

&lt;p&gt;As you embark on your Java journey, remember that Java is a versatile language, and your skills will stay relevant even as new versions emerge.&lt;/p&gt;

&lt;p&gt;Now, let's write some Java code and explore the endless possibilities of this powerful programming language. Happy coding!&lt;/p&gt;

</description>
      <category>webdev</category>
      <category>programming</category>
      <category>beginners</category>
      <category>java</category>
    </item>
  </channel>
</rss>
