✅Java Loops

Loops executed the code as long as the condition is true. They are very useful to repeat a block of code.

There are a couple of loops. I will focus on the two most use.
👇

👉while
👉for

Let's see them in more detail
👇
#Java #100DaysOfCode
while 👉 use a while loop when you don't know how many times you want to execute the code.

for 👉 use the for loop when you know how many times you want to execute the block of code.

Example👇while and for loop
#Java #100DaysOfCode
Example code can be downloaded 👉 github.com/jmejiamu/java-…

Make sure you follow me on GitHub too 😄
if you don't mind kindly RT. 👋

• • •

Missing some Tweet in this thread? You can try to force a refresh
 

Keep Current with Jose Mejia

Jose Mejia Profile picture

Stay in touch and get notified when new unrolls are available from this author!

Read all threads

This Thread may be Removed Anytime!

PDF

Twitter may remove this content at anytime! Save it as PDF for later use!

Try unrolling a thread yourself!

how to unroll video
  1. Follow @ThreadReaderApp to mention us!

  2. From a Twitter thread mention us with a keyword "unroll"
@threadreaderapp unroll

Practice here first or read more on our help page!

More from @JoseMejia62

23 Sep
✅Java If statement

if statements are combined with logical conditions. Here is a thread about them so you can have an idea of what they are.

if statements allow us to make different actions and make different decision base on a logical test.

#Java #100DaysOfCode
cont...
✅Now let's take a look at the different conditional statements.

if👉 executed if condition return true
else 👉 executed if the if condition return false
else if 👉new condition if first condition return false.

example 👇
#Java #100DaysOfCode
✅Ternary Operator

This is a shortcut for "if else". it has three operands: condition, an expression that returns true, and expression which returns false.

Example👇
#Java #100DaysOfCode
Read 4 tweets
22 Sep
✅Java

✅String manipulation

Strings are a collection of characters. The keyword String is an object and comes with a lot of useful methods to manipulate a text.

Let's see some of the basic
👇
#Java #DEVCommunity #100daysofcoding
✅The basic method to manipulate a String

length() - return the number of characters that the text contain

toUpperCase() - it will change the text to capital letters

toLowerCase() - it will change the text to lower case

concat() - it adds two strings together.

Ex.👇
#Java
✅How do we add special characters to String?

✅The value of the string must be in quotes ex. "hello". To obtain the output - Joe's car. We need the help of "\".

✅Let's see how \ can help us to accomplish that.

Continue...
#Java #DEVCommunity
Read 6 tweets

Did Thread Reader help you today?

Support us! We are indie developers!


This site is made by just two indie developers on a laptop doing marketing, support and development! Read more about the story.

Become a Premium Member ($3/month or $30/year) and get exclusive features!

Become Premium

Too expensive? Make a small donation by buying us coffee ($5) or help with server cost ($10)

Donate via Paypal Become our Patreon

Thank you for your support!

Follow Us on Twitter!

:(