The Artima Developer Community
Sponsored Link

Java Answers Forum
')' expected at line 22

1 reply on 1 page. Most recent reply: Oct 2, 2002 4:16 AM by Singh M.

Welcome Guest
  Sign In

Go back to the topic listing  Back to Topic List Click to reply to this topic  Reply to this Topic Click to search messages in this forum  Search Forum Click for a threaded view of the topic  Threaded View   
Previous Topic   Next Topic
Flat View: This topic has 1 reply on 1 page
Brook

Posts: 12
Nickname: brook
Registered: Sep, 2002

')' expected at line 22 Posted: Oct 1, 2002 4:52 PM
Reply to this message Reply
Advertisement
WHAT'S WRONG HERE? The idea is to print out the verses that the User requests, obviously counting down. THANKS.

public class SongVerse {
public static void main(String[] args)
{
final int LIMIT = 49;
int count = 50;
{
int Sverse = Console.readInt ("Enter a number of verses");
}
for (Sverse = 0; Sverse <=50; Sverse++);
{
System.out.println (" + count + " times I sing this line " + count + " times I sing, start again and sing whats left");

count = count -1;
}
System.out.println(count + "times I'll sing this song");

Sverse = Sverse - 1;
}
}


Singh M.

Posts: 154
Nickname: ms
Registered: Mar, 2002

Re: ')' expected at line 22 Posted: Oct 2, 2002 4:16 AM
Reply to this message Reply
Two problems are obvious....

1. for (Sverse = 0; Sverse <=50; Sverse++);
take out the semicolon at the end of this line. Otherwise your for loop is useless.

2. System.out.println (" + count + " times I sing this line " + count + " times I sing, start again and sing whats left");

The first double quote is unmatched.

Flat View: This topic has 1 reply on 1 page
Topic: EJB question Previous Topic   Next Topic Topic: Custom Tree Editor and Tab control problem

Sponsored Links



Google
  Web Artima.com   

Copyright © 1996-2019 Artima, Inc. All Rights Reserved. - Privacy Policy - Terms of Use