SLC S22 Week1 || Getting Started with Java and Eclipse

imohmitch -


Designed wwith canva

Greetings steemians, I am very elated to take part in this first course on java by @kouba01, which kicks start with Java and eclipse. I had little knowledge about coding though we were taught about coding basics in my year 1 and 2, which brings alot of awareness in my coding journey. I have come across java several times but not as coding application but as a gaming application.

Write a detailed explanation of the differences between JDK, JRE, and JVM

when talking about all these components, it is important to take a very detailed observation about them as they all work together to make develop an application. now in an expanded view, i will talk about each component, talking about their roles, functionalities and interdependence.

Graphic illustrations

Designed with canva

Now, from this illustration it will be very easy for anyone to understand the concept between JDK, JVM and JRE. Let's look at the chef, the cooking utensils, both the chef and the utensils are in the kitchen. now let's look at the customer waiting for the chef, all these are happening in a restaurant.

The chef takes orders from the customer and goes into the kitchen to start preparing, now the chef is the JVM which is work is to execute that data(food) ordered. The kitchen utensil used which contained tools used in preparing the food is the java libraries where the tools needed are stored. The kitchen as a whole where all of this cooking takes place is now the JRE, which is the environment in which the creating and executing of data takes place.

The customer waiting can be the java compiler and other java development tools. The whole hotel where this whole scene takes place is known as the JDK.

Install and Set Up Your Java Development Environment and provide step-by-step screenshots of the installation process, Eclipse configuration.

From the post i was able to access the link to the oracle official website and i was able to download my JDK from the official website.

While the page was done loading i changed from linux to windows as i am using windows and i dowloaded the x64Mi installer

Based on the instructions from my operating system, i went on to the editing environment, went to advanced and then environment variables. i went to the java files down there and i paste the java code i copied from the directory file i downloaded.

To check if this app was successfully installed in your device, you move to the command prompt by simply searching on the search bar of your windows. and type in java --version which will load the data to show it was successfully installed.

INSTALLING ECLIPSE

this was quite easy as i went to the link given to by our teacher Eclipse

It was quite easy as i had the link to the app already, i went on to downloads and i found the latest version for my windows and i clicked on download which didn't take up to 2 minutes.

After downloads i immediately went on to install, this took close to 4 minutes to install, i had all the patience to wait till it was ready to be used.

Write a program that calculates and displays the sum of the first 100 integers. Define the main method in a class named Sum to handle the entire calculation.

on opening my app, i was able to locate file, i then click on new and the java project. i typed in my project name which is sum as required by the task. i created a class to work in by simply clicking on the project then new and then class, i ticked the public static void main... box and clicked finish.

to get that sum of the numbers, i was able to declare the variable to display the sum of the first 100 integers. when i executed the code i was able to get 5050 which shows that the i=1 which ranges to <=100 and ++ which indicates a maximizing manner.

as reuested, i was able to create another class for sum2.java. The variable to calculate the first 100 integers on a separate function which is the calculatesum function. This makes use of the integer from 100 to calculate the first 100 integers

translate, Complete, and Debug the Following Program Named Tax.java:**

in this task we were given an incomplete task to complete and aslo debug. First thing i did was to create a new project calling it Tax. i created a class for it. the project will require us adding the whole tax which was given in the task.


The total tax which was gotten from all the three tax was 5050 as concluded by the code.

Using the same program structure as in the previous exercise, write a program named Conversion.java that takes a character c as a parameter and:

using the same method i was able to create the project and also code it to make conversions and the result is down below.

Using a similar structure as in the previous exercises, write a program named ArrayOperations.java that performs operations on an integer array

i followed the same format to create my array project. using the functions which will handle every operations to be carried out.


this gives the numbers in ascending order, the largest element in the array and so on.

to get the empty array, i pulled off the numbers there and it gave out the statement

cc, @kouba01