Can Not Compile - Help!
posted 17 years ago
-
-
Number of slices to send:Optional 'thank-you' note:
-
-
I have the following code that is for a insertionsort, problem is I think my code looks good but I can not get it to compile? I do not see what I am missing ? Any ideas what I am missing ? Thank you everyone for all the help.
posted 17 years ago
-
-
Number of slices to send:Optional 'thank-you' note:
-
-
what do you mean by 'not compile'? what, EXACTLY, is the error message? The easier you make it for us, the more likely someone can help you.
There are only two hard things in computer science: cache invalidation, naming things, and off-by-one errors
G. Graz
Ranch Hand
Posts: 30
posted 17 years ago
-
-
Number of slices to send:Optional 'thank-you' note:
-
-
Sorry , Running my code with out errors ? I use textpad and I am getting this message:
array required, but E found
for(s = i; s > 0 && t.compareTo(t[s - 1]) < 0; s--)
Ok, sorry I thought "Compile" was a common term ?
Greg
array required, but E found
for(s = i; s > 0 && t.compareTo(t[s - 1]) < 0; s--)
Ok, sorry I thought "Compile" was a common term ?
Greg
posted 17 years ago
-
-
Number of slices to send:Optional 'thank-you' note:
-
-
And when you get that message, the ^ is pointing to t[s - 1]...
So what exactly is t[s - 1]? Focus on that, and you will see that the error message is telling you exactly what the problem is.
So what exactly is t[s - 1]? Focus on that, and you will see that the error message is telling you exactly what the problem is.
"We're kind of on the level of crossword puzzle writers... And no one ever goes to them and gives them an award." ~Joe Strummer
sscce.org
posted 17 years ago
Ofcourse it is, but Fred means: tell us exactly what the error message is that the compiler gives you (copy and paste it from the command prompt, for example) - if you only say "it doesn't work", then it's much more work for anyone who's reading your question to find out what might be wrong. In other words, tell the details.
-
-
Number of slices to send:Optional 'thank-you' note:
-
-
Originally posted by Greg Grazioli:
Ok, sorry I thought "Compile" was a common term ?
Ofcourse it is, but Fred means: tell us exactly what the error message is that the compiler gives you (copy and paste it from the command prompt, for example) - if you only say "it doesn't work", then it's much more work for anyone who's reading your question to find out what might be wrong. In other words, tell the details.
posted 17 years ago
-
-
Number of slices to send:Optional 'thank-you' note:
-
-
Marc is right - you're mixing up two variables.
SCJP 1.4 - SCJP 6 - SCWCD 5 - OCEEJBD 6 - OCEJPAD 6
How To Ask Questions How To Answer Questions
posted 17 years ago
-
-
Number of slices to send:Optional 'thank-you' note:
-
-
when you said 'can't compile', that could mean:
Your OS can't find the javac.exe
Your OS can't find various classes
Your OS can't find your .java class
the compiler returns an error
and probably a few other things. Each of these things requires a different path to diagnose and fix. And if it is the last one, the error message give TREMENDOUS amounts of details on what the problem is, and WHERE it is. Posting that (since you already have it) saves anyone who wants to help you the trouble of copying your code into their editor, saving it, then compiling it yourself.
If you had posted that error message in your original post, it could have saved lots of time for the folks helping you.
Your OS can't find the javac.exe
Your OS can't find various classes
Your OS can't find your .java class
the compiler returns an error
and probably a few other things. Each of these things requires a different path to diagnose and fix. And if it is the last one, the error message give TREMENDOUS amounts of details on what the problem is, and WHERE it is. Posting that (since you already have it) saves anyone who wants to help you the trouble of copying your code into their editor, saving it, then compiling it yourself.
If you had posted that error message in your original post, it could have saved lots of time for the folks helping you.
There are only two hard things in computer science: cache invalidation, naming things, and off-by-one errors
| See where your hand is? Not there. It's next to this tiny ad: Paul Wheaton's 16th Kickstarter: Gardening playing cards for gardeners and homesteaders https://coderanch.com/t/889615/Paul-Wheaton-Kickstarter-Gardening-playing |









