Question:

Why doesn't this java code work?

by  |  earlier

0 LIKES UnLike

http://www.kaydell.com/forums/read.php?89,85

 Tags:

   Report

2 ANSWERS


  1. Because of the semi-colon AFTER the for loop

    before

    for (int i = 0; i < 10; i++);

    after

    for (int i = 0; i < 10; i++)


  2. public class NullForLoop {

              public static void main(String[] args) {

    System.out.println("Entering main()");

    for (int i = 0; i < 10; i++) {

    System.out.println("How come this is done only once?");

    }

    System.out.println("Exiting main()");

    }



    }

    This code will work bcoz there was only semicolon mistake at the end of the for loop

Question Stats

Latest activity: earlier.
This question has 2 answers.

BECOME A GUIDE

Share your knowledge and help people by answering questions.
Unanswered Questions