aspose file tools*
The moose likes Beginning Java and the fly likes Why This Compiler Error? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "Why This Compiler Error?" Watch "Why This Compiler Error?" New topic
Author

Why This Compiler Error?

Gary Farms
Ranch Hand

Joined: Jun 24, 2000
Posts: 57
When I compile the following A.java program, I get the following compile error: cannot resolve symbol - constructor A (java.lang.String) and it flags the super statement. Can anyone tell me why???
Here's the small A.java program:

(edited by Cindy to format code)

[This message has been edited by Cindy Glass (edited August 21, 2001).]
Cindy Glass
"The Hood"
Sheriff

Joined: Sep 29, 2000
Posts: 8521
Whatever you are using for double quotes in your super constructor println statement is not really a double quote. It translates as an accented o when I compile it. I replaced those with proper double quotes and it worked just fine.
Prints out :
Gary David Farms
B


"JavaRanch, where the deer and the Certified play" - David O'Meara
Gary Farms
Ranch Hand

Joined: Jun 24, 2000
Posts: 57
Originally posted by Cindy Glass:
I keep getting the weird v shaped double quotes from my keyboard. I'm entering this file in MS Word in text file format.
What could be causing this???
Whatever you are using for double quotes in your super constructor println statement is not really a double quote. It translates as an accented o when I compile it. I replaced those with proper double quotes and it worked just fine.
Prints out :
Gary David Farms
B

Cindy Glass
"The Hood"
Sheriff

Joined: Sep 29, 2000
Posts: 8521
MSWord is the problem. It has those cute little intelligent quotes that are death to a java program.
Thats why everyone keeps saying that they use Notepad or Wordpad. The file MUST be saved as txt only.
Gary Farms
Ranch Hand

Joined: Jun 24, 2000
Posts: 57
Cindy:
I re-entered the program in Notepad as a .txt file. I STILL get the same compile error on the super statement. WHY??? I cut the exact code using the Notepad editor. Here it is below. could you compile this Notepad version and see if it also compiles cleanly for you?

Originally posted by Cindy Glass:
MSWord is the problem. It has those cute little intelligent quotes that are death to a java program.
Thats why everyone keeps saying that they use Notepad or Wordpad. The file MUST be saved as txt only.


[This message has been edited by Cindy Glass (edited August 21, 2001).]
Cindy Glass
"The Hood"
Sheriff

Joined: Sep 29, 2000
Posts: 8521
Works fine. Of course I had to specifically say "SAVE AS" and then pick text file.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Why This Compiler Error?
 
Similar Threads
why compile the file there are two class file was created?
Question ID :962546675280 jqplus
anglefire.com question
Constructor in subclass only?
super().this()!