Results 1 to 2 of 2
  1. #1
    goldhouse is offline Senior Member
    Join Date
    Mar 2007
    Posts
    134
    Rep Power
    0

    Default Enhanced For loop In Java

    Java Code:
    		Vector<String> v = new Vector<String>();
    		  v.add("one"); 
    		  v.add("two");
    		  v.add("three");
    		  for(String str : v){
    		  System.out.println(str);
    		  }
    OUTPUT:
    one
    two
    three
    This is how we can use the enhanced for loop in java. The "v" can be any
    collection or array.

  2. #2
    pegitha is offline Member
    Join Date
    Apr 2007
    Location
    Indiana
    Posts
    83
    Rep Power
    0

Similar Threads

  1. Replies: 0
    Last Post: 11-14-2007, 04:22 PM
  2. Enhanced for loop
    By Java Tip in forum Java Tip
    Replies: 0
    Last Post: 11-03-2007, 10:24 PM
  3. Help with loop in java
    By trill in forum New To Java
    Replies: 1
    Last Post: 08-07-2007, 08:36 AM
  4. Help, loop with java
    By cachi in forum New To Java
    Replies: 5
    Last Post: 08-01-2007, 07:03 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •