I have checked my braces and it seems that main() was not closed as you said, but I now have more errors than before. I have pasted the contents of a file created by typing
javac accounting.java 2> err.txt into the cmd line.accounting.java:27: non-static method parseFilesStack(java.util.Scanner[]) cannot be referenced from a static context parseFilesStack(files);//takes each line of the file and uses a stack to determine profit/loss ^ accounting.java:39: Stack is abstract; cannot be instantiated Stack stack=new Stack();
^ accounting.java:41: cannot find symbol symbol : constructor File(java.util.Scanner) location: class java.io.File temp=new Scanner(new File(files[i]));//make temp 0-size file of files array to examine it
^ accounting.java:43: incompatible types found : java.lang.String required: java.util.Scanner cline=temp.nextLine();//set cline to current line of file
^ accounting.java:48: operator + cannot be applied to int,void finalDollars+=stack.push(dollars);
^ accounting.java:53: cannot find symbol symbol : variable input location: class accounting amount=input.nextInt();
^ accounting.java:55: pop() in Stack cannot be applied to (int) finalDollars-=stack.pop(dollars);
^ accounting.java:60: cannot return a value from method whose result type is void return 5;
^ Note: accounting.java uses unchecked or unsafe operations. Note: Recompile with -Xlint:unchecked for details. 8 errors
Have a great day, Alex
----- Original Message ----- From: "Sina Bahram" <sbahram@xxxxxxxxx To: <programmingblind@xxxxxxxxxxxxx Date sent: Mon, 31 Mar 2008 23:22:52 -0400Subject: RE: another java question--method call not working when
it should
Can I get the exact error message please?
Also, capitolize Exception.
Do also make sure you've ended the previous method correctly ...
Sometimes a
missing right brace can cause lots of issues.
What version of java is this?
Take care, Sina
-----Original Message----- From: programmingblind-bounce@xxxxxxxxxxxxx[mailto:programmingblind-bounce@xxxxxxxxxxxxx] On Behalf Of Alex
Hall
Sent: Monday, March 31, 2008 11:23 PM To: programmingblind@xxxxxxxxxxxxxSubject: RE: another java question--method call not working when
it should
Method signature: public void parseFilesStack(Scanner[] files) throws exception{
And the call: parseFilesStack(files);
Have a great day, Alex
----- Original Message ----- From: "Sina Bahram" <sbahram@xxxxxxxxx To: <programmingblind@xxxxxxxxxxxxx Date sent: Mon, 31 Mar 2008 22:55:41 -0400 Subject: RE: another java question--method call not working whenit should
Please paste in here only the signature line of the method.
Take care, Sina
-----Original Message----- From: programmingblind-bounce@xxxxxxxxxxxxx [mailto:programmingblind-bounce@xxxxxxxxxxxxx] On Behalf Of AlexHallSent: Monday, March 31, 2008 10:37 PM To: programmingblind@xxxxxxxxxxxxx Subject: another java question--method call not working when itshould
Hi all. I have a method with return type void, but when I callit it says"invalid method declaration; return type required". Then, for the same line, it says "<identifier> expected". Again,the methodin question is VOID, meaning no return type. Even when I toss ina returnstatement, returning an int from the method in question, it givesme thesame errors. Also, is there an easier way to review the list ofcompilererrors in EdSharp than recompiling and listening to them all overagain?Thanks.
Have a great day, Alex __________ View the list's information and change your settings at //www.freelists.org/list/programmingblind
__________ View the list's information and change your settings at //www.freelists.org/list/programmingblind
__________ View the list's information and change your settings at //www.freelists.org/list/programmingblind
__________ View the list's information and change your settings at //www.freelists.org/list/programmingblind
__________View the list's information and change your settings at //www.freelists.org/list/programmingblind