This week's book giveaway is in the Cloud/Virtualization forum.
We're giving away four copies of Learning OpenStack Networking: Build a solid foundation in virtual networking technologies for OpenStack-based clouds and have James Denton on-line!
See this thread for details.
Win a copy of Learning OpenStack Networking: Build a solid foundation in virtual networking technologies for OpenStack-based clouds this week in the Cloud/Virtualization forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Liutauras Vilda
  • Campbell Ritchie
  • Tim Cooke
  • Bear Bibeault
  • Devaka Cooray
Sheriffs:
  • Jeanne Boyarsky
  • Knute Snortum
  • Junilu Lacar
Saloon Keepers:
  • Tim Moores
  • Ganesh Patekar
  • Stephan van Hulst
  • Pete Letkeman
  • Carey Brown
Bartenders:
  • Tim Holloway
  • Ron McLeod
  • Vijitha Kumara

cannot find symbol inside String?  RSS feed

 
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
 
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
 
Java Cowboy
Sheriff
Posts: 16084
88
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!