• 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 Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

cannot find symbol inside String?

 
Ranch Hand
Posts: 135
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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 VI Editor Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
Posts: 16084
88
Android Scala IntelliJ IDE Spring Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I still see single quotes in line 58.
 
Christophe Verré
Sheriff
Posts: 14691
16
Eclipse IDE VI Editor Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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's never done THAT before. Explain it to me tiny ad:
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic