Error message
3 Message(s) by 2 Author(s) originally posted in java help
| From: sdlt85 |
Date: Wednesday, October 17, 2007
|
Hi I am having problems with my code.
It is given me an
error message stating "cannot find symbol variable
NotCont" on
line 26.
1-import JAVA.util.Scanner;
2-public
class IntegerSetTest
3-{
4- public static void main(String[] args)
5- {
6- Scanner input = new Scanner (System.in);
7-
8- System.out.println("Welcome to the Integer Set\n");
9-
10- System.out.println("This
program is going to find the
union "
+
11- " or intersection of any two sets you enter" +
12- "\nPlease enter the number of sets: ");
13- int intArray[] = new int[100];
14- int value;
15- try
16- {
17- do
18- {
19- int i;
20-
21- value = input.nextInt();
22- intArray[i]=value;
23- System.out.println("Enter -1 to end: ");
24- int NotCont = input.nextInt();
25- i++;
26- }while(NotCont != -1);
27-
28- for(int i=0; i<intArray.length;i++)
29- {
30- System.out.println(intArray[i]);
31- }
32- }
33- catch(NumberFormatException ex)
34- {
35- }
36- }
37-}
| From: Roedy Green |
Date: Thursday, October 18, 2007
|
wrote in message, quoted or
indirectly quoted someone who said :
{
19- int i;
20-
21- value = input.nextInt();
22- intArray[i]=value;
23- System.out.println("Enter -1 to end: ");
24- int NotCont = input.nextInt();
25- i++;
26- }while(NotCont != -1);1. NotCont shoud start with a lower case letter since it is a local
variable. See
http://mindprod.com/jgloss/codingconventions.html
2. NotCont is declared inside the while block. It isn't known
outside the block. You need to move the declaration to a block
enclosing all its usages.
--
Roedy
Green Canadian Mind Products
The JAVA Glossary
http://mindprod.com
| From: Roedy Green |
Date: Friday, October 19, 2007
|
wrote in message, quoted or
indirectly quoted someone who said :
Hi I am having problems with my code.
It is given me an error message stating "cannot find symbol variable
NotCont" on line 26.
First thing to try in that situation is to look up the error message.
http://mindprod.com/jgloss/compileerrormessages.html#CANNOTFINDSYMBOL
The clues as to what it means and what causes it are often sufficient.
--
Roedy Green Canadian Mind Products
The JAVA Glossary
http://mindprod.com
Next Message: Open and read CSV or text file from JSP
Blogs related to Error message
Unmarshalling Error : unexpected element (uri:"", local:"starttime")
JIoEndpoint$Worker.run(JIoEndpoint.
java:447) at
java.lang.Thread.run(Thread.
java:619) Caused by: javax.xml.bind.UnmarshalException - with linked exception: [javax.xml.bind.UnmarshalException: unexpected element (uri:"",
...
Re: [groovy-user] Better error messages?
The class name for the driver is wrong, but I what I am saying is that the error message should be more helpful and indicative of the problem.
Thanks,
...
Re: [groovy-user] Better error messages?
On 10/15/07, Fred Janon
wrote: > The class name for the driver is wrong, but I what I am saying is that the > error message should be more helpful and indicative of the problem. > > Thanks, > > Fred > > > On 10/15/07, ...
hi debian folks java i have debian sarge on a vserver and syslog ...
!tell sayers about ask please provide exact commands you’re trying to use and error messages that you get. use a pastebin if more than two lines. How do a convert filename from one KOI to UTF charset? using recode or iconv ...
Xfire Soap Request error
org.mule.umo.routing.RoutingException: Failed to route event via endpoint: null. Message payload is of type: String at org.mule.routing.outbound.OutboundRouterCollection.route(OutboundRouterCollection.java:75 ) at org.mule.impl.model. ...
so I have java 6 4 hard drives I originally thought I would have ...
level1, you should boot into the livecd and review /var/log/ for an error message before it locks up. great, thanks. okay, hold on. Is there any way to fix the terminal keystrokes? any package? any conf? I tried using emacs in a bare ...