This week's giveaway is in the Android forum.
We're giving away four copies of Android Security Essentials Live Lessons and have Godfrey Nolan on-line!
See this thread for details.
The moose likes Beginning Java and the fly likes cannot find symbol inside String? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "cannot find symbol inside String?" Watch "cannot find symbol inside String?" New topic
Author

cannot find symbol inside String?

Ben Hultin
Ranch Hand

Joined: Aug 17, 2009
Posts: 135
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

Joined: Nov 24, 2005
Posts: 14687
    
  16

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.


[My Blog]
All roads lead to JavaRanch
Ben Hultin
Ranch Hand

Joined: Aug 17, 2009
Posts: 135
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
Saloon Keeper

Joined: Aug 16, 2005
Posts: 14074
    
  16

I still see single quotes in line 58.


Java Beginners FAQ - JavaRanch SCJP FAQ - The Java Tutorial - Java SE 7 API documentation
Scala Notes - My blog about Scala
Christophe Verré
Sheriff

Joined: Nov 24, 2005
Posts: 14687
    
  16

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.
 
Consider Paul's rocket mass heater.
 
subject: cannot find symbol inside String?
 
Similar Threads
Scanner class doubt
operator && cannot be applied to boolean,int - error
regular expression problems
variables not found with OOP
my inverted index not successfull