Meaningless Drivel is fun!*
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
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: 14688
    
  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: 14432
    
  23

I still see single quotes in line 58.


Java Beginners FAQ - JavaRanch SCJP FAQ - The Java Tutorial - Java SE 8 API documentation
Christophe Verré
Sheriff

Joined: Nov 24, 2005
Posts: 14688
    
  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.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: cannot find symbol inside String?