Wrox Programmer Forums
|
BOOK: Beginning Java 2, JDK 5 Edition
This is the forum to discuss the Wrox book Ivor Horton's Beginning Java 2, JDK 5 Edition by Ivor Horton; ISBN: 9780764568749
Welcome to the p2p.wrox.com Forums.

You are currently viewing the BOOK: Beginning Java 2, JDK 5 Edition section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old May 11th, 2006, 07:01 AM
Registered User
 
Join Date: Apr 2006
Posts: 8
Thanks: 0
Thanked 0 Times in 0 Posts
Default CollectionForLoop cannot compile

public class CollectionForLoop{
    enum Season {spring,summer,fall,winter }

    public static void main(String[] args) {
        for (Season season:Season.valuse())
        {
            System.out.println("The season is now "+season);
        }
    }

}
"CollectionForLoop.java": ';' expected at line 2, column 21


 
Old May 17th, 2006, 01:22 AM
Registered User
 
Join Date: May 2006
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Default

You wrote the wrong letter for the method .
It should be :for (Season season:Season.values())
Then you can hava a try!
 
Old June 11th, 2006, 09:55 PM
Registered User
 
Join Date: Apr 2006
Posts: 8
Thanks: 0
Thanked 0 Times in 0 Posts
Default

you are right






Similar Threads
Thread Thread Starter Forum Replies Last Post
compile aspb ASP.NET 2.0 Professional 1 September 12th, 2006 10:22 AM
compile aspb ASP.NET 2.0 Basics 0 September 8th, 2006 10:27 AM
Compile Louisa VB.NET 2002/2003 Basics 1 November 23rd, 2005 10:14 AM
C# compile biran Visual Studio 2005 1 July 15th, 2005 01:36 PM
How Compile the First Example ? AlexPerusso BOOK: Beginning Visual C++ 6 3 April 8th, 2005 10:44 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.