<?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 Atanda Oluchi Aminat on Medium]]></title>
        <description><![CDATA[Stories by Atanda Oluchi Aminat on Medium]]></description>
        <link>https://medium.com/@atandaoluchiaminat?source=rss-b5d4d1ef7627------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*E4Dx-G-s-YlWUuHHz17N8A.jpeg</url>
            <title>Stories by Atanda Oluchi Aminat on Medium</title>
            <link>https://medium.com/@atandaoluchiaminat?source=rss-b5d4d1ef7627------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sun, 22 Nov 2026 10:42:16 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@atandaoluchiaminat/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[Using JDBC for CRUD Operations in Java]]></title>
            <description><![CDATA[<div class="medium-feed-item"><p class="medium-feed-snippet">In this article, we will explore how to perform basic CRUD (Create, Read, Update, Delete) operations using Java Database Connectivity&#x2026;</p><p class="medium-feed-link"><a href="https://blog.devgenius.io/using-jdbc-for-crud-operations-in-java-915d41de1e1f?source=rss-b5d4d1ef7627------2">Continue reading on Dev Genius »</a></p></div>]]></description>
            <link>https://blog.devgenius.io/using-jdbc-for-crud-operations-in-java-915d41de1e1f?source=rss-b5d4d1ef7627------2</link>
            <guid isPermaLink="false">https://medium.com/p/915d41de1e1f</guid>
            <category><![CDATA[jdbc-connection]]></category>
            <category><![CDATA[java]]></category>
            <category><![CDATA[database]]></category>
            <category><![CDATA[jdbc]]></category>
            <category><![CDATA[jdbc-driver]]></category>
            <dc:creator><![CDATA[Atanda Oluchi Aminat]]></dc:creator>
            <pubDate>Mon, 22 Sep 2025 06:44:06 GMT</pubDate>
            <atom:updated>2025-09-22T06:44:06.824Z</atom:updated>
        </item>
        <item>
            <title><![CDATA[Connecting Java Project to MySQL: A Step-by-Step Guide]]></title>
            <description><![CDATA[<div class="medium-feed-item"><p class="medium-feed-image"><a href="https://towardsdev.com/connecting-java-project-to-mysql-a-step-by-step-guide-a41222d14cdf?source=rss-b5d4d1ef7627------2"><img src="https://cdn-images-1.medium.com/max/2560/1*M3aUh7XraJNUCjgPtUhmEw.jpeg" width="2560"></a></p><p class="medium-feed-snippet">Java is a high-level, object-oriented programming language. It is a platform-independent language, meaning you can write the Java code on&#x2026;</p><p class="medium-feed-link"><a href="https://towardsdev.com/connecting-java-project-to-mysql-a-step-by-step-guide-a41222d14cdf?source=rss-b5d4d1ef7627------2">Continue reading on Towards Dev »</a></p></div>]]></description>
            <link>https://towardsdev.com/connecting-java-project-to-mysql-a-step-by-step-guide-a41222d14cdf?source=rss-b5d4d1ef7627------2</link>
            <guid isPermaLink="false">https://medium.com/p/a41222d14cdf</guid>
            <category><![CDATA[database]]></category>
            <category><![CDATA[java]]></category>
            <dc:creator><![CDATA[Atanda Oluchi Aminat]]></dc:creator>
            <pubDate>Thu, 05 Dec 2024 11:23:03 GMT</pubDate>
            <atom:updated>2025-09-20T13:17:50.918Z</atom:updated>
        </item>
        <item>
            <title><![CDATA[A Comprehensive Guide to Reading and Writing Files in Java]]></title>
            <link>https://towardsdev.com/a-comprehensive-guide-to-reading-and-writing-files-in-java-16bd75f92c42?source=rss-b5d4d1ef7627------2</link>
            <guid isPermaLink="false">https://medium.com/p/16bd75f92c42</guid>
            <category><![CDATA[coding]]></category>
            <category><![CDATA[java-developer]]></category>
            <category><![CDATA[java-roadmap]]></category>
            <category><![CDATA[java-development]]></category>
            <category><![CDATA[java]]></category>
            <dc:creator><![CDATA[Atanda Oluchi Aminat]]></dc:creator>
            <pubDate>Mon, 06 May 2024 14:44:39 GMT</pubDate>
            <atom:updated>2024-06-05T16:45:18.108Z</atom:updated>
            <content:encoded><![CDATA[<p>In the world of programming, handling file operations is a crucial skill. Java Programming language provides powerful tools and libraries to efficiently read from and write to files. So, whether you are working with text files, binary files, or even CSVs, Java’s File I/O capabilities are robust and flexible. In this article, we’ll explore the various ways to perform file operations in Java.</p><h4>1. Reading from Text Files:</h4><p>Reading from a text file in Java is straightforward. Here’s a basic example of how to do that with comments to explain each line of code:</p><pre>/* <br>***<br><br>import the necessary classes from the java.io package for reading files. <br>BufferedReader is used for efficient reading of characters and <br>FileReader is used to read the contents of a file<br><br>*** <br>*/<br>import java.io.BufferedReader;<br>import java.io.FileReader;<br>import java.io.IOException;<br>public class FileReaderExample { //Defining class FileReaderExample<br>    public static void main(String[] args) { <br>//main method (the entry point of the Java program)<br><br>/* <br>declare a String variable to store the path of the text file <br>you want to read. You should replace &quot;path/to/your/file.txt&quot; with the <br>actual path to your file. <br>*/<br>        String filePath = &quot;path/to/your/file.txt&quot;;<br><br>/* <br>Begin a try catch block. Initialize the `BufferedReader` with a new <br>instance of `FileReader` that takes `filePath` as an argument. <br>This ensures that the file is opened for reading.<br><br>The `BufferedReader` allows us to read the text from the input stream <br>efficiently by buffering the characters.<br> <br>The try catch statement ensures that the `BufferedReader` is closed <br>automatically after the try block finishes, whether an exception occurs or not.<br>This is important for resource management and avoids memory leaks.<br><br>*/<br>        try (BufferedReader br = <br>                new BufferedReader(new FileReader(filePath))) {<br>//Declare a `String` variable to store each line read from the file.<br>            String line;<br>/*<br>There should be a while loop that reads each line from the file until <br>readLine() returns `null`, indicating the end of the file. <br>That means the loop continues as long as `readLine()` does not return `null`.<br><br>br.readline reads a line of text. Each time it&#39;s called, <br>it advances to the next line in the file. We would assign each line of text <br>read to the string created earlier (in our case here, the string is line)<br>*/<br>            while ((line = br.readLine()) != null) {<br><br>/*<br>Inside the loop, each line read from the file is printed to the console <br>using `System.out.println()`. This will display the contents of the file <br>line by line.<br>*/<br>                System.out.println(line);<br>} <br>// End of the while loop.<br>        } catch (IOException e) {<br>/*<br>If an `IOException` occurs during the reading process, the program will <br>catch the exception here.<br><br>*/            <br><br>/*<br>This line prints an error message to the standard error <br>stream (`System.err`) along with the specific error message <br>provided by the `IOException` (`e.getMessage()`).<br>*/<br>System.err.println(&quot;Error reading file: &quot; + e.getMessage());<br>        }<br>    }<br>}</pre><h4>2. Writing to Text Files:</h4><p>Writing to a text file involves similar steps:</p><pre>import java.io.BufferedWriter;<br>import java.io.FileWriter;<br>import java.io.IOException;<br>public class FileWriterExample {<br>    public static void main(String[] args) {<br>        String filePath = &quot;path/to/your/output.txt&quot;;<br>        try (BufferedWriter bw = new BufferedWriter(new FileWriter(filePath))) {<br>            bw.write(&quot;Hello, world!\n&quot;);<br>            bw.write(&quot;This is a line written to the file.&quot;);<br>        } catch (IOException e) {<br>            System.err.println(&quot;Error writing to file: &quot; + e.getMessage());<br>        }<br>    }<br>}</pre><h3>Code Explanation:</h3><p>import java.io.BufferedWriter; and import java.io.FileWriter;:</p><p>These lines import the necessary classes from the java.io package for writing files. BufferedWriter is used for efficient writing of characters, and FileWriter is used to write characters to a file.</p><p>public class FileWriterExample {:</p><p>This line defines a class named FileWriterExample.</p><p>public static void main(String[] args) {:</p><p>This is the main method, the entry point of the Java program.</p><p>String filePath = &quot;path/to/your/output.txt&quot;;:</p><p>This line declares a String variable named filePath and assigns it the path to the text file you want to write to. You should replace &quot;path/to/your/output.txt&quot; with the actual path to your file.</p><p>try (BufferedWriter bw = new BufferedWriter(new FileWriter(filePath))) {:</p><p>This is the beginning of a try-with-resources block. The BufferedWriter is initialized with a new instance of FileWriter that takes filePath as an argument. This ensures that the file is opened for writing.</p><p>The BufferedWriter allows us to write text to the output stream efficiently by buffering the characters.</p><p>The try-with-resources statement ensures that the BufferedWriter is closed automatically after the try block finishes, whether an exception occurs or not. This is important for resource management and avoids memory leaks.</p><p>bw.write(&quot;Hello, world!\n&quot;); and bw.write(&quot;This is a line written to the file.&quot;);:</p><p>These lines write text to the file using the write() method of the BufferedWriter. Each write() call adds text to the file. This \n is used to insert a newline character.</p><p>} catch (IOException e) {:</p><p>If an IOException occurs during the writing process, the program will catch the exception here.</p><p>System.err.println(&quot;Error writing to file: &quot; + e.getMessage());:</p><p>This line prints an error message to the standard error stream (System.err) along with the specific error message provided by the IOException (e.getMessage()).</p><p>}:</p><p>End of the try-catch block.</p><p><strong>3. Reading and Writing Binary Files:</strong></p><p>For binary files, you would use streams like FileInputStream and FileOutputStream:</p><pre>import java.io.*;<br>public class BinaryFileExample {<br>    public static void main(String[] args) {<br>        String inputFilePath = &quot;path/to/binary/input.dat&quot;;<br>        String outputFilePath = &quot;path/to/binary/output.dat&quot;;<br>        try (FileInputStream fis = new FileInputStream(inputFilePath);<br>             FileOutputStream fos = new FileOutputStream(outputFilePath)) {<br>            int byteRead;<br>            while ((byteRead = fis.read()) != -1) {<br>                fos.write(byteRead);<br>            }<br>        } catch (IOException e) {<br>            System.err.println(&quot;Error handling binary file: &quot; + e.getMessage());<br>        }<br>    }<br>}</pre><h4>4. Using Java NIO for Advanced File Operations:</h4><p>Java NIO (New I/O) provides a more efficient and flexible way to perform file operations. Here’s a quick example:</p><pre>import java.nio.file.*;<br>import java.io.IOException;<br>import java.util.List;<br>public class NIOFileExample {<br>    public static void main(String[] args) {<br>        Path filePath = Paths.get(&quot;path/to/your/file.txt&quot;);<br>        try {<br>            List&lt;String&gt; lines = Files.readAllLines(filePath);<br>            for (String line : lines) {<br>                System.out.println(line);<br>            }<br>            // Writing to a file using NIO<br>            List&lt;String&gt; dataToWrite = List.of(&quot;Line 1&quot;, &quot;Line 2&quot;, &quot;Line 3&quot;);<br>            Files.write(filePath, dataToWrite, StandardOpenOption.CREATE);<br>        } catch (IOException e) {<br>            System.err.println(&quot;Error reading/writing file: &quot; + e.getMessage());<br>        }<br>    }<br>}</pre><h4>5. Handling Exceptions:</h4><p>When working with file I/O, always handle exceptions properly to ensure your program doesn’t crash unexpectedly. Use try and catch for automatic resource management and clean-up.</p><h4>Conclusion:</h4><p>In this guide, we’ve covered the basics of reading and writing files in Java. Whether it’s simple text files, binary files, or more advanced file operations using Java NIO, you now have the knowledge to handle file I/O effectively in your Java programs. Remember to properly handle exceptions, close resources, and explore Java’s vast libraries for more advanced file operations.</p><p>File handling is a fundamental aspect of programming, and mastering it will empower you to work with various types of data and external resources in your Java applications.</p><p><strong>Note:</strong></p><p>NIO: New Input/ Output</p><p>I/O: Input/Output</p><p>Binary Files: These files contain data in a format that is not intended to be read as text. Binary files store data in a binary format (a series of bytes). This allows binary files to store data more compactly and efficiently, and to represent complex data structures directly.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=16bd75f92c42" width="1" height="1" alt=""><hr><p><a href="https://towardsdev.com/a-comprehensive-guide-to-reading-and-writing-files-in-java-16bd75f92c42">A Comprehensive Guide to Reading and Writing Files in Java</a> was originally published in <a href="https://towardsdev.com/">Towards Dev</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[A Beginner’s Guide to Arrays in Java: Understanding 1D, 2D, and 3D Arrays]]></title>
            <link>https://towardsdev.com/a-beginners-guide-to-arrays-in-java-understanding-1d-2d-and-3d-arrays-fed08fd22246?source=rss-b5d4d1ef7627------2</link>
            <guid isPermaLink="false">https://medium.com/p/fed08fd22246</guid>
            <category><![CDATA[2d-arrays]]></category>
            <category><![CDATA[java]]></category>
            <category><![CDATA[3d-array]]></category>
            <category><![CDATA[arrays]]></category>
            <category><![CDATA[for-loop]]></category>
            <dc:creator><![CDATA[Atanda Oluchi Aminat]]></dc:creator>
            <pubDate>Fri, 29 Mar 2024 15:48:41 GMT</pubDate>
            <atom:updated>2024-03-29T15:48:41.520Z</atom:updated>
            <content:encoded><![CDATA[<p>Arrays are essential data structures in Java that allow you to store multiple values of the same type in a single variable. They are like containers that can hold several items, making it easier to manage and manipulate data. In this article, we&#39;ll explore the concept of arrays in Java, from basic one-dimensional (1D) arrays to more complex two-dimensional (2D) arrays and three-dimensional (3D) arrays. Two-dimensional (2D) arrays and three-dimensional (3D) arrays are extensions of the basic array concept, allowing you to store data in a matrix-like structure.</p><h3>What is an Array?</h3><p><strong>Definition</strong></p><p>An array is a collection of variables of the same type that are referenced by a common name. Think of an array as a row of boxes, where each box can store a single value. The boxes are numbered, and you can access the values by referring to their corresponding index (box number).</p><h3>One-dimensional (1D) arrays</h3><p>A one-dimensional (1D) array is like a single row of boxes, each containing a single value.</p><p><strong>Declaration and Initialization:</strong></p><pre>// Declaration and initialization of a 1D array <br>dataType[] arrayName = new dataType[size];  <br>// Example: <br>int[] numbers = new int[5]; // Creates an array of 5 integers</pre><p><strong>Accessing Elements:</strong></p><ul><li>Each element in a 1D array has an index starting from 0.</li><li>From the declaration above numbers[0] refers to the first element, numbers[1] refers to the second element, and so on.</li><li>Example:</li></ul><pre>int[] numbers = {10, 20, 30, 40, 50}; // Initializing with values <br>System.out.println(numbers[2]); // Output: 30</pre><h4>Use Case:</h4><ul><li>When you need to store a list of values of the same data type.</li></ul><h4>Examples:</h4><ul><li>Storing a list of student names.</li><li>Keeping track of scores in a game.</li><li>Representing temperatures for each day of the week.</li></ul><h4>Benefits:</h4><ul><li>Straightforward for storing linear data.</li><li>Efficient for accessing individual elements by index.</li><li>Useful when dealing with a single list or sequence of values.</li></ul><h3><strong>Two-Dimensional (2D) Arrays</strong></h3><p>A 2D array in Java is an array of arrays. It is essentially a matrix with rows and columns. You can think of it as an array of rows, where each row is an array itself.</p><pre>Declaration and Initialization:<br>// Declaration and initialization of a 2D array<br>dataType[][] arrayName = new dataType[rows][columns];</pre><pre>// Example:<br>int[][] matrix = new int[3][3]; // 3x3 integer matrix</pre><pre>Initializing with Values:<br>// Initializing a 2D array with values<br>dataType[][] arrayName = {<br> {val11, val12, val13},<br> {val21, val22, val23},<br> // More rows…<br>};</pre><pre>// Example:<br>int[][] matrix = {<br> {1, 2, 3},<br> {4, 5, 6},<br> {7, 8, 9}<br>};<br></pre><p><strong>Accessing Elements:<br></strong>// Accessing elements in a 2D array<br>dataType value = arrayName[rowIndex][columnIndex];</p><p>// Example:<br>int element = matrix[1][2]; // Accesses element at row 1, column 2 (value 6)</p><h4><strong>Use Case</strong></h4><p>When you need to represent data in a tabular or grid-like format with rows and columns.</p><h4><strong>Examples:</strong></h4><ul><li>Storing data for a spreadsheet or table.</li><li>Representing a game board (like in tic-tac-toe).</li><li>Handling pixel data in images.</li></ul><h4><strong>Benefits:</strong></h4><ul><li>Allows for the representation of two-dimensional data structures.</li><li>Useful for matrices, tables, grids, and representing relationships between rows and columns.</li><li>Provides an organized way to manage data that naturally fits into rows and columns.</li></ul><h3><strong>Three-Dimensional (3D) Arrays</strong></h3><p>A 3D array in Java is an array of 2D arrays. It is a collection of 2D matrices, forming a cube-like structure.</p><pre>Declaration and Initialization:<br>// Declaration and initialization of a 3D array<br>dataType[][][] arrayName = new dataType[depth][rows][columns];</pre><pre>// Example:<br>int[][][] cube = new int[3][3][3]; // 3x3x3 integer cube<br></pre><pre>Initializing with Values:<br>// Initializing a 3D array with values<br>dataType[][][] arrayName = {<br> {<br> {val111, val112, val113},<br> {val121, val122, val123},<br> // More rows…<br> },<br> {<br> {val211, val212, val213},<br> {val221, val222, val223},<br> // More rows…<br> },<br> // More depth…<br>};</pre><pre>// Example:<br>int[][][] cube = {<br> {<br> {1, 2, 3},<br> {4, 5, 6},<br> {7, 8, 9}<br> },<br> {<br> {10, 11, 12},<br> {13, 14, 15},<br> {16, 17, 18}<br> },<br> {<br> {19, 20, 21},<br> {22, 23, 24},<br> {25, 26, 27}<br> }<br>};<br></pre><p><strong>Accessing Elements:<br></strong>// Accessing elements in a 3D array<br>dataType value = arrayName[depthIndex][rowIndex][columnIndex];</p><p>// Example:<br>int element = cube[1][2][0]; // Accesses element at depth 1, row 2, column 0 (value 16)</p><h4>Use Case:</h4><p>When you need to represent data in a 3D space, such as cubes, layers, or matrices of matrices.</p><h4>Examples:</h4><ul><li>Storing pixel colour data for a 3D image (like MRI scans).</li><li>Representing a Rubik&#39;s cube.</li><li>Handling 3D coordinate systems.</li></ul><h4>Benefits:</h4><ul><li>Allows for the representation of data in a 3D space or multi-dimensional cubes.</li><li>Useful for representing complex 3D structures or matrices of matrices.</li><li>Provides a way to handle data that has depth, height, and width dimensions.</li></ul><h4><strong>Iterating Through 2D and 3D Arrays:</strong></h4><p>You can use nested loops to iterate through 2D and 3D arrays.</p><p><strong>Iterating Through a 2D Array:</strong></p><pre>for (int i = 0; i &lt; matrix.length; i++) {<br> for (int j = 0; j &lt; matrix[i].length; j++) {<br> int element = matrix[i][j];<br> System.out.print(element + “ “);<br> }<br> System.out.println(); // Move to the next line for the next row<br>}</pre><p><strong>Iterating Through a 3D Array:</strong></p><pre>for (int i = 0; i &lt; cube.length; i++) {<br> System.out.println(“Depth “ + i + “:”);<br> for (int j = 0; j &lt; cube[i].length; j++) {<br> for (int k = 0; k &lt; cube[i][j].length; k++) {<br> int element = cube[i][j][k];<br> System.out.print(element + “ “);<br> }<br> System.out.println(); // Move to the next line for the next row<br> }<br> System.out.println(); // Move to the next line for the next depth<br>}</pre><h3>Fun Programming exercises you can do with Arrays</h3><p>Here are some fun things you can do with different types of arrays:</p><h4>1D Arrays:</h4><p>1. Number Guessing Game:</p><ul><li>Create an array of random numbers.</li><li>Ask the user to guess a number and check if it exists in the array.</li></ul><p>2. Word Jumble Game:</p><ul><li>Store a list of words in an array.</li><li>Shuffle the letters of a random word and ask the user to guess the original word.</li></ul><h4>2D Arrays:</h4><p>1. Tic-Tac-Toe Game:</p><ul><li>Create a 2D array to represent the game board.</li><li>Implement the logic to play against a friend or an AI.</li></ul><p>2. Matrix Operations:</p><ul><li>Perform matrix operations such as addition, multiplication, and transposition using 2D arrays.</li></ul><h4>3D Arrays:</h4><p>1. Cube Puzzle Game:</p><ul><li>Represent a Rubik&#39;s cube with a 3D array.</li><li>Implement a solver or a game interface to manipulate the cube.</li></ul><h3>Fun Coding Examples:</h3><p>1. Rainbow Colors:</p><ul><li>Create a 1D array with colours of the rainbow (ROYGBIV).</li><li>Use a loop to display the colours in order, creating a rainbow effect (in words)</li></ul><pre>String[] rainbowColors = {&quot;Red&quot;, &quot;Orange&quot;, &quot;Yellow&quot;, &quot;Green&quot;, &quot;Blue&quot;, &quot;Indigo&quot;, &quot;Violet&quot;};<br>for (String color : rainbowColors) {<br>    System.out.println(color);<br>}</pre><p>2. Perform Matrix Addition Operation:</p><pre>int[][] matrix1 = {<br>            {1, 2, 3},<br>            {4, 5, 6},<br>            {7, 8, 9}<br>        };<br><br>        int[][] matrix2 = {<br>            {9, 8, 7},<br>            {6, 5, 4},<br>            {3, 2, 1}<br>        };<br><br>        int rows = matrix1.length;<br>        int columns = matrix1[0].length;<br><br>        int[][] sumMatrix = new int[rows][columns];<br><br>        // Adding corresponding elements of both matrices<br>        for (int i = 0; i &lt; rows; i++) {<br>            for (int j = 0; j &lt; columns; j++) {<br>                sumMatrix[i][j] = matrix1[i][j] + matrix2[i][j];<br>            }<br>        }<br><br>        // Displaying the sum matrix<br>        System.out.println(&quot;Sum of Matrices:&quot;);<br>        displayMatrix(sumMatrix);<br>    }<br><br>    // Helper method to display a matrix<br>    public static void displayMatrix(int[][] matrix) {<br>        for (int[] row : matrix) {<br>            for (int num : row) {<br>                System.out.print(num + &quot; &quot;);<br>            }<br>            System.out.println();<br>        }<br>    }</pre><p>Using the method above try to perform other matrix operations such as transposition and multiplication.</p><h3>Conclusion:</h3><ul><li>2D Arrays are used for spreadsheet programs, image processing, game boards, mapping, and student grades.</li><li>3D Arrays are usually utilized in medical imaging, video games, scientific data analysis, CAD software, animation, and graphics.</li></ul><p>#100daysofcoding #day5</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=fed08fd22246" width="1" height="1" alt=""><hr><p><a href="https://towardsdev.com/a-beginners-guide-to-arrays-in-java-understanding-1d-2d-and-3d-arrays-fed08fd22246">A Beginner’s Guide to Arrays in Java: Understanding 1D, 2D, and 3D Arrays</a> was originally published in <a href="https://towardsdev.com/">Towards Dev</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[A Deep Dive into Object Orientation in Java]]></title>
            <link>https://towardsdev.com/a-deep-dive-into-object-orientation-in-java-7bdc97e95838?source=rss-b5d4d1ef7627------2</link>
            <guid isPermaLink="false">https://medium.com/p/7bdc97e95838</guid>
            <category><![CDATA[polymorphism]]></category>
            <category><![CDATA[encapsulation]]></category>
            <category><![CDATA[object-oriented]]></category>
            <category><![CDATA[object-orientation]]></category>
            <category><![CDATA[java]]></category>
            <dc:creator><![CDATA[Atanda Oluchi Aminat]]></dc:creator>
            <pubDate>Mon, 25 Mar 2024 14:54:49 GMT</pubDate>
            <atom:updated>2024-03-29T14:57:18.420Z</atom:updated>
            <content:encoded><![CDATA[<p>Object-oriented programming (OOP) is a powerful paradigm that allows developers to model real-world entities as objects with properties (attributes) and behaviours (methods). Java is an object-oriented programming language that embraces these principles at its core. In this article, we’ll take a comprehensive look at object orientation in Java, exploring classes, objects, inheritance, polymorphism, encapsulation, and more.</p><h4><strong>Understanding Classes and Objects</strong></h4><p><strong>Classes: Blueprints of Objects</strong></p><ul><li>Think of a Blueprint: Imagine you want to build a house. Before actually building it, you create a blueprint that tells the construction workers how the house should be built. In Java, a class is like that blueprint.</li><li>Definition: A class is a blueprint for creating objects. It defines what an object will be made of and what it can do.</li><li>Properties: In a house blueprint, you might have things like number of rooms, color, size, etc. Similarly, a class has properties called “fields” or “attributes.” These represent the characteristics of the object.</li><li>Actions: In a house, you can open doors, turn on lights, etc. In a class, you have “methods” or “functions” that define what actions an object can perform.</li></ul><p>Let’s create a simple `Car` class as an example:</p><pre>public class Car {<br> private String brand;<br> private int year;</pre><pre>private String color;<br> <br> public Car(String brand, int year, String color) {<br> this.brand = brand;<br> this.year = year;</pre><pre>this.color = color;<br> }</pre><pre>// Methods or actions<br> public void displayInfo() {<br> System.out.println(“Brand: “ + brand + “, Year: “ + year);<br> }</pre><pre>public void start() { </pre><pre>System.out.println(“The car is starting.”); </pre><pre>} </pre><pre>public void drive() { </pre><pre>System.out.println(“The car is driving.”); </pre><pre>} </pre><pre>public void stop() { </pre><pre>System.out.println(“The car has stopped.”); </pre><pre>}<br>}</pre><p><strong>Objects: Instances of Classes</strong></p><ul><li>After creating a blueprint, you can build a house using that plan. Similarly, an object is a real, tangible thing created using a class blueprint.</li><li>Creation: When you create an object, it’s like making a new house using the house blueprint. Creating objects of a class, instantiation and creating an instance of a class are terms you might see here. They all mean the same thing.</li><li>Attributes: Each object has its own set of attributes based on the class. For example, one car object might be a “Toyota” with a “Red” color and “2022” year, while another could be a “Honda” with a “Blue” color and “2023” year.</li><li>Actions: Objects can perform actions defined in the class methods. Just like how a car object can “start,” “drive,” and “stop.”</li></ul><p>Here’s how we can create and use objects of the `Car` class:</p><pre>public class Main {<br> public static void main(String[] args) {<br> Car car1 = new Car(&quot;Toyota&quot;, 2022); //Creating Objects (Instantiation)<br>Car car2 = new Car(“Honda”, 2023);<br> <br> car1.displayInfo(); // Output: Brand: Toyota, Year: 2022<br> car2.displayInfo(); // Output: Brand: Honda, Year: 2023<br> }<br>}</pre><h4><strong>Inheritance: Extending Classes</strong></h4><p>Think of Parent-Child Relationship, just like you inherit traits from your parents (like eye colour or height), in programming, inheritance is when one class (the child) can inherit properties and behaviours from another class (the parent).</p><p>This fundamental concept in OOP allows you to create a new class based on an existing class, inheriting its fields and methods. This promotes code reuse and helps in organizing code.</p><p>The child class can still add its fields and methods, making it more specialized while having everything from its parent.</p><p>Inheritance is a fundamental concept in OOP that allows a class (subclass) to inherit properties and behaviours from another class (superclass). This promotes code reusability and establishes an “is-a” relationship.</p><p>We already created a Car class when we were discussing class above, we would create another class SUV which would inherit properties and methods from its parent class ‘’Car’</p><pre>public class SUV extends Car {<br> public SUV(String brand, int year) {<br> super(brand, year); //Calling parent class constructor<br> }<br> <br> public void displaySUVInfo() {<br> System.out.println(“This is an SUV.”);<br> }<br>}</pre><p>Here, `SUV` is a subclass of `Car` and inherits the `brand` and `year` fields along with the `displayInfo()` method. It can also have additional methods like `displaySUVInfo()`.</p><p>Note:</p><ul><li>The super keyword is used to refer to the parent class or call the parent class&#39;s constructor.</li><li>It is used in subclasses to access methods or fields from the superclass, just like it is used in class SUV here to access methods and fields from the superclass Car.</li></ul><h4><strong>Polymorphism: Multiple Forms</strong></h4><p>Polymorphism allows objects of different classes to be treated as objects of a common superclass. This enables methods to behave differently based on the object they are operating on.</p><pre>public class Main {<br> public static void main(String[] args) {<br> Car car1 = new Car(“Toyota”, 2022);<br> SUV suv1 = new SUV(“Ford”, 2024);<br> <br> car1.displayInfo(); // Output: Brand: Toyota, Year: 2022<br> suv1.displayInfo(); // Output: Brand: Ford, Year: 2024<br> <br> Car myCar = new SUV(“Chevrolet”, 2023);<br> myCar.displayInfo(); // Output: Brand: Chevrolet, Year: 2023 (dynamic method dispatch)<br> }<br>}<br></pre><p>In this example, `myCar` is of type `Car`, but it points to an instance of `SUV`. When `displayInfo()` is called, Java determines at runtime which version of `displayInfo()` to invoke based on the actual type of the object (`SUV` in this case).</p><p><strong>Another Example:</strong></p><blockquote>// Parent class (Animal)<br>public class Animal {<br> public void makeSound() {<br> System.out.println(“Some sound”);<br> }<br>}</blockquote><blockquote>// Child class (Dog) overrides makeSound()<br>public class Dog extends Animal {<br> <a href="http://twitter.com/Override">@Override</a><br> public void makeSound() {<br> System.out.println(“Woof!”);<br> }<br>}</blockquote><pre>// Child class (Cat) overrides makeSound()<br>public class Cat extends Animal {<br> @Override<br> public void makeSound() {<br> System.out.println(“Meow!”);<br> }<br>}</pre><p>using Polymorphism in another class</p><pre>Animal animal1 = new Dog();<br>Animal animal2 = new Cat();</pre><pre>animal1.makeSound(); // Output: Woof!<br>animal2.makeSound(); // Output: Meow!</pre><h4><strong>Encapsulation: Data Hiding</strong></h4><p>Encapsulation is the concept of bundling data (fields) and methods that operate on that data within a single unit (class). Access to the data is restricted to methods of the class, providing control over data modification and ensuring data integrity.</p><pre>public class Person {<br> private String name;<br> private int age;<br> <br> public Person(String name, int age) {<br> this.name = name;<br> this.age = age;<br> }<br> <br> public String getName() {<br> return name;<br> }<br> <br> public int getAge() {<br> return age;<br> }<br> <br> public void setName(String name) {<br> this.name = name;<br> }<br> <br> public void setAge(int age) {<br> this.age = age;<br> }<br>}</pre><p>In this `Person` class, the `name` and `age` fields are private, and access is provided through getter and setter methods. This ensures that data is accessed and modified through controlled methods, preventing direct access to the fields.</p><h4><strong>Abstraction: Hiding Complexity</strong></h4><p>Abstraction is the process of hiding the implementation details of methods and providing only essential features to the outside world. It allows developers to focus on what an object does rather than how it does it.</p><p><strong>Abstract Classes:</strong></p><ul><li>An abstract class in Java is a class that cannot be instantiated on its own. It serves as a blueprint for other classes to inherit from.</li><li>It may contain abstract (methods without implementation) and concrete (methods with implementation) methods.</li><li>Abstract methods are declared without a body and must be implemented by non-abstract subclasses.</li><li>Abstract classes can have constructors, fields, and regular methods.</li><li>Abstract classes can be used to define common behaviours and characteristics that subclasses can inherit and implement.</li></ul><p>Example of an abstract class:</p><pre>public abstract class Shape {<br> protected String color;</pre><pre>// Abstract method (no implementation)<br> public abstract double calculateArea();</pre><pre>// Concrete method<br> public void setColor(String color) {<br> this.color = color;<br> }</pre><pre>// Concrete method<br> public String getColor() {<br> return color;<br> }<br>}</pre><p>`Shape` is an abstract class with an abstract method `calculateArea()`.</p><h4>Example of Concrete Subclass Implementing the Abstract Class:</h4><pre>public class Circle extends Shape {<br>    private double radius;<br><br>    public Circle(double radius) {<br>        this.radius = radius;<br>    }<br><br>    @Override<br>    public double calculateArea() {<br>        return Math.PI * radius * radius;<br>    }<br>}</pre><p>Concrete subclasses like `Circle` will provide their implementations of calculateArea(), hiding the specific calculations for the outside world.</p><p><strong>When to Use Abstraction:</strong></p><ul><li>Use abstraction when you want to define a blueprint for a group of subclasses to follow.</li><li>Use abstract classes when you have some implementation of methods that can be shared among multiple subclasses.</li></ul><h4><strong>Conclusion</strong></h4><p>Object orientation in Java is a robust and versatile paradigm that facilitates the creation of modular, reusable, and maintainable code. By understanding classes, objects, inheritance, polymorphism, encapsulation, and abstraction, Java developers can design elegant and efficient solutions to complex problems.</p><p>As you continue your journey into Java programming, remember the power of object orientation and how it can elevate the quality and scalability of your code.</p><p>Happy coding!</p><p>#100daysofcoding2024 #Day4</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=7bdc97e95838" width="1" height="1" alt=""><hr><p><a href="https://towardsdev.com/a-deep-dive-into-object-orientation-in-java-7bdc97e95838">A Deep Dive into Object Orientation in Java</a> was originally published in <a href="https://towardsdev.com/">Towards Dev</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Everything You Need to Know About Classes and Objects in Java]]></title>
            <link>https://blog.devgenius.io/everything-you-need-to-know-about-classes-and-objects-in-java-1c9ac780ce98?source=rss-b5d4d1ef7627------2</link>
            <guid isPermaLink="false">https://medium.com/p/1c9ac780ce98</guid>
            <category><![CDATA[class]]></category>
            <category><![CDATA[object-oriented]]></category>
            <category><![CDATA[objects-in-java]]></category>
            <category><![CDATA[objectorientedprogramming]]></category>
            <category><![CDATA[java]]></category>
            <dc:creator><![CDATA[Atanda Oluchi Aminat]]></dc:creator>
            <pubDate>Fri, 22 Mar 2024 12:51:13 GMT</pubDate>
            <atom:updated>2024-03-25T10:49:02.268Z</atom:updated>
            <content:encoded><![CDATA[<p>Java is an object-oriented programming language that revolves around the concepts of classes and objects. Grasping these fundamental concepts is crucial to deepen understanding of Java concepts. Let’s delve into everything you need to know about classes and objects in Java.</p><h3>Understanding Classes</h3><p>A class is a blueprint for creating objects. It defines the properties (attributes) and behaviours (methods) that objects of that class will have. Think of a class as a template or a cookie cutter, and objects as the cookies made from that template.</p><h3>Syntax of a Class</h3><p>To declare a class in Java, you use the following syntax:</p><pre>public class MyClass {<br> // Variables (attributes)<br> private int myVariable;<br> <br> // Constructor<br> public MyClass() {<br> // Constructor code here<br> }<br> <br> // Methods<br> public void myMethod() {<br> // Method code here<br> }<br>}</pre><p>Note:</p><p>From the syntax above,</p><p><strong>Variables (Attributes):</strong> These are the data members of the class, representing its state. They define what each object of the class will hold. These are usually called instance variables because they are declared within a class and outside any method. They are also associated with the objects (instances) of a class.</p><p><strong>Constructor</strong>: Constructors are special methods used for initializing objects. If you don’t explicitly define a constructor (parameterized constructor), Java provides a default constructor (with no parameters). However, you can define your constructors using this syntax:</p><pre>public class Car {<br> String brand;<br> int year;<br> <br> // Default constructor<br> public Car() {<br> brand = “Unknown”;<br> year = 0;<br> }<br> <br> // Parameterized constructor<br> public Car(String brand, int year) {<br> this.brand = brand;<br> this.year = year;<br> }<br>}</pre><p><strong>Methods</strong>: These are the functions defined within the class that perform actions and can manipulate the object’s state.</p><p><strong>Access Modifiers: </strong>Access modifiers in Java specify the accessibility or scope of classes, fields, methods, and constructors. They control how these members can be accessed from other classes and packages. Java provides four types of access modifiers:<strong><br>1. </strong>public:<br>The public keyword is an access modifier that makes a member (field, method, or class) accessible from any other class. It has the widest scope among access modifiers.<br>2. private:<br>The private keyword is an access modifier that only allows access to the member within the same class. It ensures that the member is not accessible from outside the class.<br>3. protected:<br>The protected keyword is an access modifier that allows access to the member within the same package and by subclasses (even in different packages). It is often used in inheritance scenarios.<br>4. default (no modifier):<br>If no access modifier is specified, the member has package-private access.<br>It allows access to the member within the same package.</p><h3>Example Class</h3><p>Let’s create a simple Person class to illustrate:</p><pre>public class Person {<br> // Attributes<br> private String name;<br> private int age;<br> <br> // Constructor<br> public Person(String name, int age) {<br> this.name = name;<br> this.age = age;<br> }<br> <br> // Method that returns nothing<br> public void displayDetails() {<br> System.out.println(“Name: “ + name);<br> System.out.println(“Age: “ + age);<br> }<br>}</pre><h3><strong>Creating Objects</strong></h3><p>Once a class has been defined, we can create objects of that class. Objects are instances of a class — they represent real-world entities based on the class blueprint.</p><h3>Syntax to Create an Object</h3><p>To create an object of a class, you use the new keyword followed by a call to the class constructor:</p><p>// Creating an object of the Person class<br>Person person1 = new Person(“John”, 25);<br>Person person2 = new Person(“Jane”, 30);</p><p>From the code snippet above, person1 and person2 are objects of the Person class, each with its name and age attributes.</p><h3>Accessing Class Members</h3><p>You can access the attributes and methods of an object using the dot (.) notation:</p><pre>// Accessing attributes<br>System.out.println(person1.name); // Output: John<br>System.out.println(person2.age); // Output: 30</pre><pre>// Calling methods<br>person1.displayDetails();<br>person2.displayDetails();</pre><h3><strong>Getters and Setters</strong></h3><p>Getters and setters in Java are methods used to access and modify the private fields (instance variables) of a class. They are part of the concept of encapsulation, which hides the internal state of an object and provides controlled access to it. Getters are used to retrieve the values of private fields, while setters are used to modify or set the values of private fields.</p><p><strong>Getters (Accessor Methods):<br></strong>- Getters are methods that are used to retrieve the values of private fields.<br>- They are typically named with the prefix `get` followed by the name of the field they are getting.<br>- Getters do not modify the object’s state; they simply return the value of a field.<br>- Getters often have a return type that matches the type of the field they are getting.<br>- Getters are commonly used to access private fields from outside the class.</p><pre>Example:<br><br>public class Person {<br> private String name;<br>// Getter method for ‘name’<br> public String getName() {<br> return name;<br> }<br>}</pre><p><strong>Setters (Mutator Methods):<br></strong>- Setters are methods used to modify or set the values of private fields.<br>- They are typically named with the prefix `set` followed by the name of the field they are setting.<br>- Setters take an argument that represents the new value to be assigned to the field.<br>- Setters allow for validation logic, ensuring that only valid values are assigned to fields.<br>- Setters are commonly used to update the state of an object from outside the class.</p><pre>Example:<br><br>public class Person {<br> private String name;<br>// Setter method for ‘name’<br> public void setName(String name) {<br> this.name = name;<br> }<br>}</pre><h3>Advantages of exposing data through methods rather than through Instance Variables</h3><p>Exposing data through methods, such as getters and setters, rather than directly through instance variables provides several advantages in terms of encapsulation, data integrity, flexibility, and security. Here’s why it’s generally considered safer to use getters and setters than using instance variables:</p><ol><li>Getters and setters provide a controlled way to access and modify data. They allow you to enforce validation rules, access controls, and business logic. For example, if a field should not have negative values, you can validate this in the setter method.</li><li>Flexibility: Methods allow you to change the internal representation of data without affecting the external interface. This is crucial for maintaining compatibility with existing code while making internal changes.</li><li>Code Readability: Using meaningful method names like `getName()` and `setName()` makes the code more readable and self-explanatory.</li><li>Code Maintenance: When you need to add validation or change how a field is accessed or modified, you can do so within the getter or setter method without affecting other parts of the code.</li></ol><pre>Example:<br>public class BankAccount {<br> private double balance;// Getter method<br> public double getBalance() {<br> return balance;<br> }<br>// Setter method with validation<br> public void deposit(double amount) {<br> if (amount &gt; 0) {<br> balance += amount;<br> } else {<br> System.out.println(“Invalid amount for deposit.”);<br> }<br> }<br>// Setter method with validation<br> public void withdraw(double amount) {<br> if (amount &gt; 0 &amp;&amp; amount &lt;= balance) {<br> balance -= amount;<br> } else {<br> System.out.println(“Invalid amount for withdrawal.”);<br> }<br> }<br>}</pre><p>In this example, the `balance` field is kept private. The `getBalance()` method allows controlled access to the `balance` without directly exposing it. The `deposit()` and `withdraw()` methods validate the input before updating the `balance`. This encapsulation and data hiding ensure the integrity and security of the `BankAccount` object’s state.</p><p>Summary:<br>- Exposing data through methods (getters and setters) rather than directly through instance variables promotes encapsulation, data hiding, and code maintainability.<br>- It provides controlled access to the data, enforces validation rules, improves security, and reduces coupling between classes.<br>- By following these practices, you create classes with well-defined interfaces, making your code more reliable, understandable, and adaptable to changes.</p><h3><strong>Keywords to note:</strong></h3><ol><li>new:</li></ol><p>The new keyword is used to create a new instance (object) of a class in another class.<br>It allocates memory for the object and calls the constructor to initialize it.<br>Example:<br><br>MyClass obj = new MyClass();</p><p>2. this: The this keyword is a reference to the current object.<br>It is used to access instance variables and methods within the class.<br>Example:<br><br>public class MyClass {<br> private int value;<br> <br> public void setValue(int value) {<br> this.value = value; // Using “this” to refer to the instance variable<br> }<br>}</p><h3>Conclusion</h3><p>Classes and objects are the building blocks of Java programming, allowing for organized, efficient, and reusable code. By understanding how to define classes, create objects, and utilize their attributes and methods, you have unlocked a powerful aspect of Java’s object-oriented nature.</p><p>As you continue your journey in Java development, practice implementing classes, creating objects, and exploring advanced concepts like inheritance and polymorphism. With a solid grasp of classes and objects, you are well-equipped to design robust and scalable Java applications.</p><p>Happy coding!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=1c9ac780ce98" width="1" height="1" alt=""><hr><p><a href="https://blog.devgenius.io/everything-you-need-to-know-about-classes-and-objects-in-java-1c9ac780ce98">Everything You Need to Know About Classes and Objects in Java</a> was originally published in <a href="https://blog.devgenius.io/">Dev Genius</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Leveraging mathematical problems as coding exercises]]></title>
            <description><![CDATA[<div class="medium-feed-item"><p class="medium-feed-snippet">By leveraging mathematical problems as coding exercises, individuals can sharpen their programming skills while honing their mathematical&#x2026;</p><p class="medium-feed-link"><a href="https://medium.com/@atandaoluchiaminat/using-mathematical-problems-to-sharpen-coding-programming-concepts-eec1f5119dce?source=rss-b5d4d1ef7627------2">Continue reading on Medium »</a></p></div>]]></description>
            <link>https://medium.com/@atandaoluchiaminat/using-mathematical-problems-to-sharpen-coding-programming-concepts-eec1f5119dce?source=rss-b5d4d1ef7627------2</link>
            <guid isPermaLink="false">https://medium.com/p/eec1f5119dce</guid>
            <category><![CDATA[programming-languages]]></category>
            <category><![CDATA[tips]]></category>
            <category><![CDATA[tips-and-tricks]]></category>
            <category><![CDATA[programming]]></category>
            <category><![CDATA[mathematics]]></category>
            <dc:creator><![CDATA[Atanda Oluchi Aminat]]></dc:creator>
            <pubDate>Wed, 14 Feb 2024 08:27:45 GMT</pubDate>
            <atom:updated>2024-02-15T10:18:31.080Z</atom:updated>
        </item>
        <item>
            <title><![CDATA[Seven (7) General Coding/ Programming Tips]]></title>
            <description><![CDATA[<div class="medium-feed-item"><p class="medium-feed-snippet">Coding/ programming is the process or act of writing instructions used by a computer system to perform specific tasks. Code is made up of&#x2026;</p><p class="medium-feed-link"><a href="https://medium.com/@atandaoluchiaminat/seven-7-general-coding-programming-tips-a6fb910550b1?source=rss-b5d4d1ef7627------2">Continue reading on Medium »</a></p></div>]]></description>
            <link>https://medium.com/@atandaoluchiaminat/seven-7-general-coding-programming-tips-a6fb910550b1?source=rss-b5d4d1ef7627------2</link>
            <guid isPermaLink="false">https://medium.com/p/a6fb910550b1</guid>
            <category><![CDATA[coding]]></category>
            <category><![CDATA[tips]]></category>
            <category><![CDATA[programming]]></category>
            <category><![CDATA[tips-and-tricks]]></category>
            <dc:creator><![CDATA[Atanda Oluchi Aminat]]></dc:creator>
            <pubDate>Mon, 12 Feb 2024 22:12:37 GMT</pubDate>
            <atom:updated>2024-02-12T22:12:37.791Z</atom:updated>
        </item>
        <item>
            <title><![CDATA[How to create a React JS Application Using Vite (Part I)]]></title>
            <link>https://towardsdev.com/the-first-phase-of-creating-a-react-js-application-9ec993255fd2?source=rss-b5d4d1ef7627------2</link>
            <guid isPermaLink="false">https://medium.com/p/9ec993255fd2</guid>
            <category><![CDATA[reactjs-development]]></category>
            <category><![CDATA[reactjs]]></category>
            <category><![CDATA[react-js-tutorials]]></category>
            <category><![CDATA[react]]></category>
            <dc:creator><![CDATA[Atanda Oluchi Aminat]]></dc:creator>
            <pubDate>Thu, 13 Jul 2023 08:03:39 GMT</pubDate>
            <atom:updated>2023-10-03T05:53:00.912Z</atom:updated>
            <content:encoded><![CDATA[<p>There are other alternatives to use when creating a React application such as using the Create React App (CRA), webpack and lots more.</p><p>In this article, we will look at how powerful it is to use React with Vite, a lightning-fast build tool for JavaScript and TypeScript projects. A lot of people use the JavaScript library React to make user interfaces for websites and mobile applications, and Vite is a great choice for current web development because it is fast and easy to use. We’ll talk about the tools and technologies we’ll be using, set up our working environment, and walk you through the most important steps to get your React project with Vite off the ground in this first part. You’ll have a good understanding of how to use Vite to make fast and useful React apps by the end of this guide.</p><p>Let’s jump right in and start using the power of these two cutting-edge tools!</p><h3><strong>Why you need to learn React JS</strong></h3><ol><li>As a beginner who has a basic understanding of HTML, CSS, and Javascript, React is an easier Javascript library to learn and use to build web applications because of its similarity to basic Javascript, which makes it easy to debug, and its active community support when you run into errors.</li><li>Frontend developers need to learn React JS because it makes it easier for developers to create reusable functional components such as buttons, cards, navbar, modal, input and many more components, which makes it easier to build complex user interfaces.</li><li>Mobile app developers need to learn React JS because it is a prerequisite to learning React Native, which is a cross-platform mobile app development framework that allows developers to use ReactJS to create native mobile apps.</li></ol><p>Note:<br>The prerequisite to learning React JS is:</p><ol><li>HTML</li><li>CSS</li><li>Javascript</li></ol><h3><strong>Setting up a Development Environment for React JS</strong></h3><ol><li>node version 16 or higher is required</li></ol><p>To check the node version, go to the terminal and type node -v</p><p>If you have a lower version than what is required, in a terminal, type nvm install — lts, to update npm</p><figure><img alt="check node version" src="https://cdn-images-1.medium.com/max/314/1*PoThnQKHKuXT9OZTIwrKhw.png" /></figure><figure><img alt="install latest nvm" src="https://cdn-images-1.medium.com/max/740/1*BYGbrbqp8Qaw_oBGuU10Ww.png" /></figure><p>After this, your version of the node should have been upgraded to the latest version. You can check the node version again to confirm.</p><p>2. Pick an IDE (Integrated Development Environment) of your choice</p><p>I prefer VS Code. On VSCode, you can install the Prettier-Code formatter for formatting code. To do this, go to the extensions marketplace by clicking on the extension icon, search for the Prettier-Code Formatter, click on the extension, a new window pops up, and click on install.</p><figure><img alt="extension icon" src="https://cdn-images-1.medium.com/max/68/1*1qu7IXsGKzE0pDU9w0Ryug.png" /><figcaption>This icon is the extension icon to go to the extension marketplace on VScode</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*tjOgQXPMSZey3YljlBRz0A.png" /></figure><p>To enable formatting code on save, go to the settings dialog in VScode, search for format on save, and a new window will pop up. Check the format on the save box.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*OaUvHc7ucVYb1ziBDXw4AA.png" /></figure><p>You are now ready to create a React App.</p><h3><strong>Creating a React App Using Vite</strong></h3><p>Using Vite to create a React App is a much faster way with smaller bundle sizes. To use Vite, go to the terminal, navigate to the desktop directory using cd Desktop, and type npm create vite@latest.</p><p>If you have a particular version of Vite you want to use, replace the latest in the above command with the specific version type, i.e., npm create vite@4.11.</p><p>Follow the other instructions that follow. Provide a project name. Vite can be used for any kind of Javascript framework. You will be prompted to select a framework. We are using React. Use the down and up keys on your keyboard to navigate, then select React by clicking Enter on the keyboard. You would then be prompted to select a language variant, and we would select typescript</p><figure><img alt="create react app using vite" src="https://cdn-images-1.medium.com/max/683/1*5AO9PDcW-olbZiCzk9CfTw.png" /></figure><p>Now run cd ‘project name’, mine is ‘cd portfolio-project’ to change the directory to your new project. Followed by running npm install or npm i to install all the 3rd party dependencies and libraries. Then open the project in VSCode using ‘code .’ Then go to the terminal in VSCode and run the last command, which is to run the web server using npm run dev. This command should launch a web server at an address on the screen. Open the address in the browser, and our first React application has been created.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/606/1*SRaXlMupcc9v1R_2Cz8zPw.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/946/1*GhSVAQvO0EFCkJ-760aUcg.png" /></figure><figure><img alt="when you click on the address on your terminal" src="https://cdn-images-1.medium.com/max/807/1*Nsn32cBwVJNUlzhXGZnw1Q.png" /></figure><h3><strong>Key Files and Folders in a React Project</strong></h3><ol><li>node_modules folder: This is where all the third-party libraries, like React and other tools, are installed. You never have to touch this folder.</li><li>Public folder: This is where the public assets of a website exist, like images and video files.</li><li>src folder: This is the source code of our application. There is a component that represents the app component. It is called App.tsx. This file will be rewritten to suit the portfolio website we intend to build or whatever project you intend to build.</li><li>index.html file: This is a very basic HTML file or template. There is a div element with the id root, which represents the container for our application. Then there is a script element referencing src/main.tsx, which represents the entry point to our application.</li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/1011/1*JS7c-9zPxA7Kwuq8-rU37A.png" /></figure><p>5. package.json: Information about the project is found here, including the project name, project version, list of dependencies, and others.</p><p>6. Typescript configuration files: This contains a bunch of settings to tell the typescript compiler how to compile our code to Javascript. There is no need to touch this file.</p><p><strong>Note:</strong></p><p>The extension of a typescript file is ts or tsx. Ts is for plain typescript files, and tsx is for react components.</p><p>Hurray!!! You are done with the first phase of creating a React JS Application. Look out for details of the next phase.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=9ec993255fd2" width="1" height="1" alt=""><hr><p><a href="https://towardsdev.com/the-first-phase-of-creating-a-react-js-application-9ec993255fd2">How to create a React JS Application Using Vite (Part I)</a> was originally published in <a href="https://towardsdev.com/">Towards Dev</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Guide to Hosting a Technology Workshop in Nigeria: A First-Timer’s Perspective]]></title>
            <link>https://medium.com/@atandaoluchiaminat/hosting-a-tech-workshop-my-experience-64f75b8ae1f0?source=rss-b5d4d1ef7627------2</link>
            <guid isPermaLink="false">https://medium.com/p/64f75b8ae1f0</guid>
            <category><![CDATA[tech-events]]></category>
            <category><![CDATA[education]]></category>
            <category><![CDATA[children-in-tech]]></category>
            <category><![CDATA[technology]]></category>
            <category><![CDATA[tech]]></category>
            <dc:creator><![CDATA[Atanda Oluchi Aminat]]></dc:creator>
            <pubDate>Mon, 26 Jun 2023 09:24:29 GMT</pubDate>
            <atom:updated>2023-10-03T06:03:02.580Z</atom:updated>
            <content:encoded><![CDATA[<p>After graduating from university in 2015, I had a dream to expose younger people, especially children, to opportunities in the digital space. On June 8, 2023, this dream became a reality at the ICT centre, Access Bank, University of Nigeria, Nsukka, Enugu State. Thanks to Meenah Code, my newly founded and registered organisation dedicated to teaching kids how to code, we hosted our first workshop with 18 Participants. The aim of this article is to guide first-timers on how to host a hands-on technology workshop in Nigeria.</p><p>Here’s a summary of my experience and plans for future projects.</p><p>Factors I considered to make the workshop successful</p><ol><li>A goal: I thought long and hard about what type of workshop I wanted to host, taking into consideration the age and attention span of my participants. I decided to go for a common game that might seem hard to develop and that I know all children their age are used to playing on their or their parent&#39;s smartphone. We went for “Developing our own version of the Subway Surfers game”.</li><li>Participants: I reached out to schools in my community and gave them letters explaining my offer and how it benefits their students. These opportunities are to train their students on how to build things with the Scratch programming language, free transportation to and from their school, refreshments, and fun games during the break.</li><li>A venue with access to laptops: The participants are children who might not have access to laptops. To enable every participant to practice what was being taught and not just theory, this was very much needed. The only venue with these requirements in my local community was the ICT centre at the University of Nigeria, Nsukka.</li><li>Volunteers: I needed people with experience using computers consistently because the participants have little or no experience operating a laptop, so I reached out to my students, colleagues at work and friends to volunteer. Some of these volunteers were given merchandise on which the Meenah Code was written. About 2 or 3 volunteers were requested to capture the moment on their phones.</li><li>Refreshments: The participants, host, and volunteers need to feel refreshed after a while of these practical classes.</li><li>Sponsors: The event was to be hosted at a venue that had laptops and internet access. This means we had to pay for the venue. We also had to pay for the refreshments, snacks, customised tops, and transportation. I had to raise money somehow. Colleagues, friends, family, and other well-wishers were the best options at the time. I contacted some, and about five people came through with wonderful donations and help. The participants also contributed a certain amount. I should look for other ways to raise money for events, maybe from companies.</li></ol><p>What went wrong during the event:</p><ol><li>The event started a little bit late, and this was because most of my volunteers were university students who had lectures that day. The event was on a weekday.</li><li>We didn’t have access to the WiFi because I forgot to remind them that we’d need it. This was not really a problem for our event, even though I would have preferred using the online version, but we downloaded the scratch software and installed it on all participants&#39; laptops.</li><li>I am still determining the number of participants. I would have loved more crowds, though. The event day was during most schools&#39; mid-term break, which I thought was a great idea, but most schools complained that they could not mobilise their wards because of this. Maybe subsequent events would be during school days.</li></ol><p>Future To- dos:</p><ol><li>Seek other ways to get funding, sponsors and more participants</li><li>Provide a way to get more detailed feedback from students and schools that participated</li><li>Work with a team during the planning of the event.</li></ol><p>Appreciations</p><p>I would like to thank my sponsors: Tayo, Faruq, AbdulRaheem, Okeychukwu, Mrs. Uzo Blessing, and Oyetunji Tawakalt, and my students who volunteered to facilitate the event: Jenifer, Francis, Onah, Julian, Peter, Xavier, Tamara, Gideon, Anita, Kosi and Nuel, and the students that volunteered to Anchor the event Francis and Ruth Akanno, students who volunteered to snap the pictures and make videos; My brother, Abdulhakeem Atanda; Greg; and our notable participants from Transfiguration Mission Schools (TMS), Nsukka, Enugu State.</p><figure><img alt="The host, participants, team and volunteers" src="https://cdn-images-1.medium.com/max/1024/1*kQI-srtSeoFYMxuWaC37nw.jpeg" /></figure><figure><img alt="The team" src="https://cdn-images-1.medium.com/max/1024/1*h1B2CWykU-a-ZgHR--TeFQ.jpeg" /></figure><figure><img alt="A student writing her version of subway sufers code" src="https://cdn-images-1.medium.com/max/1024/1*fiGW_OWFC_qEE2IYs_Ul1A.jpeg" /></figure><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=64f75b8ae1f0" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>