This week's book giveaways are in the Java EE and JavaScript forums.
We're giving away four copies each of The Java EE 7 Tutorial Volume 1 or Volume 2(winners choice) and jQuery UI in Action and have the authors on-line!
See this thread and this one for details.
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


Win a copy of The Java EE 7 Tutorial Volume 1 or Volume 2 this week in the Java EE forum
or jQuery UI in Action in the JavaScript forum!
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?