Java Programming Tutorial – 22 – for Loops

Facebook –
GitHub –
Google+ –
LinkedIn –
reddit –
Support –
thenewboston –
Twitter –






22 responses to “Java Programming Tutorial – 22 – for Loops”

  1. Saurabh Kumar Avatar

    the college isn't the best place to learn programming so newboston is where i go……

  2. Timo Assink Avatar

    nice video, I started laughing when u said twenty one … xD

  3. Arramu Maiam Avatar

    Only10% of people have made it to here. WELL DONE EVERYONE :d

  4. Marques Pierre-Louis Avatar

    Anyone know what text editor he is using?

  5. Clash with A Square Avatar

    it is still going

    import java.util.Scanner;
    class ashim{
    public static void main(String args[]){
    int x = 0;

  6. asfaha teclu Avatar

    I appreciate your teaching and happy to fellow your steps , it means so much for me

  7. DLZ Avatar

    So is this just a shorter way instead of making it longer?

  8. Choi Jai Avatar

    for(int counter =1; counter<=10;counter-=3)
    I had to shut down Java

  9. Rip chan Avatar

    is the for loop only used for when you have 3 statements inside?

  10. Bruh Avatar

    so for and while loops have the same idea but what is realy the pro's and con's of using them what time are we gonna use for loops or while loops ???

  11. Mobashsher Hossain Avatar

    *just a simple modified test*

    import java.util.Scanner;
    public class Ctg {
    public static void main(String args[]){
    System.out.println("Enter any number ");
    Scanner m1= new Scanner(;
    Double i;
    i= m1.nextDouble();
    if (i>50){System.out.println("Wrong input");}
    for(Double counter =i; counter<=50; counter+=5){


  12. ZaidCo Avatar

    Can anybody help me this is a code im writing for a basic math app(still a beginner) i want it to loop again when the if statement is not true if they get the answer wrong i want it to loop over again and let them try again the same question instead of it moving on too the next question

    //Question 2
    System.out.println("2. 12-9=");
    int usersubanswer2 = in.nextInt();

    int firstsubnum2;
    firstsubnum2 = 12;

    int secsubnum2;
    secsubnum2 = 9;

    int subanswer2;
    subanswer2 = firstsubnum2 – secsubnum2;

    if(usersubanswer2 == subanswer2){
    System.out.println(name + " Good job that was the CORRECT answer");
    System.out.println(" The answer you entered was INCORRECT");

  13. Gamer Sparta Avatar

    If i have something in the for loop and then an if statement outside the loop, it will loop trought the for loop till counter equals 10 and the it will do the if statement ?

  14. MariusBlock Gaming Avatar

    How do I take all the numbers that it gives me and then add them into a single number
    (for example I get 1 2 3 from the for loop so how do I add these 3 numbers so it gives me 6 (but not like directly from the loop just how to take those values and use them somewhere else))

  15. karan sejwar Avatar

    i am tired of treehouse ads now

  16. Jacob V Avatar

    Please, can someone explain me why this goes over 10? It stops at 11
    int i = 0;
    Scanner input = new Scanner(;

    while (i <= 10) {

Leave a Reply

Your email address will not be published. Required fields are marked *