Results 1 to 10 of 10
Thread: Unsolved errors
- 01-03-2010, 11:52 AM #1
Member
- Join Date
- Jan 2010
- Posts
- 5
- Rep Power
- 0
Unsolved errors
The following lines of code
System.out.print("Player Two: Enter Guess(1) for First Word");
String GuessOne = Keyboard.readString();
Are giving me these errors :
<Identifier> expected > for line one, build output pointing near the bracket.
and
Illegal start of type > pointing behind the bracket
Please help. Thanks :eek:
- 01-03-2010, 11:56 AM #2
- Join Date
- Sep 2008
- Location
- Voorschoten, the Netherlands
- Posts
- 11,398
- Blog Entries
- 7
- Rep Power
- 17
- 01-03-2010, 12:03 PM #3
Member
- Join Date
- Jan 2010
- Posts
- 5
- Rep Power
- 0
hi, It's not the first line in the whole program but on removing it and replacing with other code there are no errors.
- 01-03-2010, 12:06 PM #4
- Join Date
- Sep 2008
- Location
- Voorschoten, the Netherlands
- Posts
- 11,398
- Blog Entries
- 7
- Rep Power
- 17
- 01-03-2010, 12:10 PM #5
Member
- Join Date
- Jan 2010
- Posts
- 5
- Rep Power
- 0
System.out.println("Player One: Enter first word");
String Word1 = Keyboard.readString();
System.out.println("Swap Players");
System.out.println("Player Two: Enter first word Guess_1");
//counting the characters in Word1
int i = 0;
while (i < Word1.length( ))
{ i++;
}
int x = i;
//Display dashes
int u = 0;
do {
u++;
System.out.print("_ ");
}
while (u!=x);
}
//Player Two enters Guess(1) for Word1
System.out.print("Player Two: Enter Guess(1) for First Word");
String WordOneGuessone = Keyboard.readString();
}
I appreciate your help.
- 01-03-2010, 12:15 PM #6
- Join Date
- Sep 2008
- Location
- Voorschoten, the Netherlands
- Posts
- 11,398
- Blog Entries
- 7
- Rep Power
- 17
Show us the lines before the lines that are causing the trouble; we need to see some context, not a bunch of statements.
kind regards,
Jos
- 01-03-2010, 12:24 PM #7
Member
- Join Date
- Jan 2010
- Posts
- 5
- Rep Power
- 0
That's all the program.
It's homework for students who have been learning java for some weeks, it's really simple however the error is keeping me from being able to finish it.
It's done using Jcreator
- 01-03-2010, 12:44 PM #8
- Join Date
- Sep 2008
- Location
- Voorschoten, the Netherlands
- Posts
- 11,398
- Blog Entries
- 7
- Rep Power
- 17
So those lines you showed us in your first post were the first lines; that is not valid Java; you need to define a class with at least one method in it; the method body defines those statements. Java is not Basic. Please read a tutorial that covers the basics of Java before you start coding anything.
kind regards,
Jos
- 01-03-2010, 12:56 PM #9
Member
- Join Date
- Jan 2010
- Posts
- 5
- Rep Power
- 0
public class LastHangman {
public static void main(String[] args) {
that?
I have no idea what you're talking about, I'm new to java. However the programs always work after fixing minor errors. And I'm sure my teacher would get to that.
- 01-03-2010, 01:21 PM #10
- Join Date
- Sep 2008
- Location
- Voorschoten, the Netherlands
- Posts
- 11,398
- Blog Entries
- 7
- Rep Power
- 17
Similar Threads
-
Errors?
By Jamison5213 in forum New To JavaReplies: 4Last Post: 12-30-2009, 12:14 AM -
[UnSolved] Traversing Trees problem
By RllyNew2Java in forum New To JavaReplies: 8Last Post: 12-24-2009, 07:59 PM -
Errors,errors and errors
By xpatiencex in forum New To JavaReplies: 6Last Post: 04-25-2009, 04:43 AM -
What is the difference between Semantic Errors and Logical Errors?
By tlau3128 in forum New To JavaReplies: 3Last Post: 03-08-2009, 01:51 AM -
help with these errors
By oceansdepth in forum New To JavaReplies: 3Last Post: 04-16-2008, 04:55 PM


LinkBack URL
About LinkBacks


Bookmarks