• Post Reply Bookmark Topic Watch Topic
  • New Topic

cannot find symbol inside String?  RSS feed

 
Ben Hultin
Ranch Hand
Posts: 135
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have building this program that works with exception handlers, while I believe I have it down pretty good, I am getting one type of error that I am not sure about.




.\Date.java:63: ';' expected
System.out.print('please enter a valid input: ');
^
.\Date.java:63: unclosed character literal
System.out.print('please enter a valid input: ');
^
.\Date.java:63: cannot find symbol
symbol : class enter
location: class Date
System.out.print('please enter a valid input: ');
^
.\Date.java:63: cannot find symbol
symbol : class valid
location: class Date
System.out.print('please enter a valid input: ');
^



I changed the quotes from single to double to help signify a string to be printed but the JVM seems to still look at the string as a set of class identifiers or other weird types needed.

Here is my code:



Thanks for the help
 
Christophe Verré
Sheriff
Posts: 14691
16
Eclipse IDE Ubuntu VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Are you compiling the class that you saved ? Try giving it another name to make sure you're not compiling a class existing somewhere else in the classpath.
 
Ben Hultin
Ranch Hand
Posts: 135
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
well this excpetion is being handled in the driven class Date.

here is the entire file:



here is my driver class:


I am not really sure what you mean by "class that I saved" Do you mean the name of file in regards to the name of the class?

Thanks a lot
 
Jesper de Jong
Java Cowboy
Sheriff
Posts: 15862
81
Android IntelliJ IDE Java Scala Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I still see single quotes in line 58.
 
Christophe Verré
Sheriff
Posts: 14691
16
Eclipse IDE Ubuntu VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Jesper Young wrote:I still see single quotes in line 58.

I see them too

Ben, the compiler tells you that the error occurs at Line 63 of your java file. Make sure that you are looking at the right place.
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!