Win a copy of The Java Performance Companion this week in the Performance forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Why This Compiler Error?

 
Gary Farms
Ranch Hand
Posts: 57
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 8521
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
Gary Farms
Ranch Hand
Posts: 57
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 8521
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 57
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 8521
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Works fine. Of course I had to specifically say "SAVE AS" and then pick text file.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic