Today I Learned Java #1 - Variables and Data Types, Control Flow and Condition
Good morning all!
Yesterday i woke up remembering that in high school i was learning some basic of C# in computer science. Now, almost 5 years later and still stuck in university of economic and commerce, i decided to expand my knowledge and to reuse some of them.
Now now, i know that it's not that easy to learn how to program, but i also know that if i don't start from something, i'll never go anywhere with it. So i searched in internet to find a free course or a site where learn java. Why java? I'm a reddit active user and i've made an habit to search first on Reddit than use Google, because i think that Reddit is more "true", less saturated with content made to drive users to make an action on third party's website, unless we aren't talking about wikipedia or something similar. So, i was saying that i made a search on reddit, and i found this subreddit !
Through this, i've found out that i was interested on learning to program on android, so my choice was to study Java and Kotlin. After a little search (this time with google) i found lots of free courses on Udacity, more specifically this!
PART 1
And now, here i am, already finished lesson 1, a simple introduction to variables and data types. Until now, i've learned (again, after high school), how to set up all the most common variables like int, double and string.
After that, i've learned how to print an information i've got previously or a string of my choice with the command System.out.println(nameOfVariable) or System.out.println("Hello, world!").
Differences with C# 'til now are few, and only about syntax. Where C# let you write variables or print line how you want, Java will not let you, for example, write system.out.println instead of System.out.println(the only difference? The capital S.
PART 2
In a day i've made two lessons, due to the beginning of a new journey, and so i've finished that too. In second lesson i learned (again after high school) the decisions that computer have to take in programs, or the if Statement.
If is a statement that lets computer makes a decision given a condition about a variable, like this:
int numberOfCandies = 25;
if (numberOfCandies > 23)
{ System.out.println("There are more than 23 candies on the table!"); }
So i was able to pass onto the else and else-if.
Else is a condition that happen if the condition If it's false (same syntax as the If one) and else-if is a condition similar to both that happen in a specific occasion.
From what i've learned in lesson #1 and #2, i was able to complete some task on the platform to make sure to remember that with practice, so now, i'm gonna continue with lesson 3 as soon as i can :)
Congratulations @xepher! You received a personal award!
You can view your badges on your Steem Board and compare to others on the Steem Ranking
Vote for @Steemitboard as a witness to get one more award and increased upvotes!