• 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

New to programming and trying to learn and stuck!

 
Greenhorn
Posts: 8
Android Chrome
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hey everyone! Nice to meet you all.

I'm new not only to Java but any kind of programming. My end goal is to start writing programs for android and possible branch out to other possibilities as well. After a few recommendations, I went out and bought "Head First Java". So far the book seems great. I'm trying to copy one of the programs in the beginning of the book, but I'm running into some trouble trying to compile it and I can't seem to figure out what the errors mean. Here's the code that is pretty much hand copied from the book.




And here are the errors I'm getting trying to compile it. Can anyone tell me why the errors seem to be centered around random digits? Thanks in advance!
 
Sheriff
Posts: 14691
16
Eclipse IDE VI Editor Ubuntu
  • Likes 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Let's take the errors one by one.

The first error message says : cannot find symbol class string. This is the hint. In Java, everything is case-sensitive. Lowercase and uppercase really matters. The String class that you are using has to be typed "String", not "string". Correct all occurrences of "string" to "String".

There's another similar error at the bottom : cannot find symbol method Println. Same. The "println" method starts with a "p", not a "P".

So, correct all the lowercase/uppercase errors you can find, and come back when you're done

PS : you can copy/paste text from your command prompt window instead of having to use a picture
 
Christophe Verré
Sheriff
Posts: 14691
16
Eclipse IDE VI Editor Ubuntu
  • Likes 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
And welcome to the ranch
 
Ryan McKay
Greenhorn
Posts: 8
Android Chrome
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Christophe Verré wrote:And welcome to the ranch




Thank you sir! And you were right of course about the errors, but I think you already knew that. I thought that the arrows were pointing to the problem spots but there were in fact not. Thank you so much! My code compiled, and now I have another problem. I'm trying to read into the errors myself and I think it has to do with my java install but I'd like confirmation. When I try to run the code, I receive this in the terminal.

 
lowercase baba
Posts: 13089
67
Chrome Java Linux
  • Likes 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
to run your code, don't type the ".class".

it should just be:

java PhraseOMatic
 
Ryan McKay
Greenhorn
Posts: 8
Android Chrome
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thank you so much! It worked!
reply
    Bookmark Topic Watch Topic
  • New Topic