This week's book giveaways are in the Jython/Python and Object-Oriented programming forums.
We're giving away four copies each of Machine Learning for Business: Using Amazon SageMaker and Jupyter and Object Design Style Guide and have the authors on-line!
See this thread and this one for details.
Win a copy of Machine Learning for Business: Using Amazon SageMaker and JupyterE this week in the Jython/Python forum
or Object Design Style Guide in the Object-Oriented programming 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:
  • Campbell Ritchie
  • Bear Bibeault
  • Paul Clapham
  • Jeanne Boyarsky
  • Knute Snortum
Sheriffs:
  • Liutauras Vilda
  • Tim Cooke
  • Junilu Lacar
Saloon Keepers:
  • Ron McLeod
  • Stephan van Hulst
  • Tim Moores
  • Tim Holloway
  • Carey Brown
Bartenders:
  • Joe Ess
  • salvin francis
  • fred rosenberger

cannot find method println

 
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi there,

I started learning java with your OCA book and I wrote this code:



And I got this error:
(The code does compile and run without an error when the main argument is empty)

error.png
[Thumbnail for error.png]
 
Rancher
Posts: 4453
47
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Well, the first error is pointing out that you have written prinln and not println.

Can't tell about the others as you've shown an image rather than copy/paste the text here, and the image does not appear on the "make post" page, so I can't see it while writing this.
 
Dave Tolls
Rancher
Posts: 4453
47
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Oh...you have arg rather than args.
 
Sheriff
Posts: 14767
245
Mac Android IntelliJ IDE Eclipse IDE Spring Debian Java Ubuntu Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Programming is very precise about spelling, especially when it comes to parameter and method names.. Wouldn't you complain if people called you Leter instead of Lester?

The error messages tell you which names you misspelled.
 
Lester van Dinteren
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Oh lol, that is funny, just some typos

Thank you very much!
 
Ranch Foreman
Posts: 86
11
Firefox Browser MySQL Database Java Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Always go through any error messages carefully. For simple errors, the error messages will usually tell you exactly what is wrong. Here it is telling you that it can't find 'prinln' or 'arg'. If it can't find it, it does not exist.

Tip: I usually tackle the first error, then recompile. Take them one by one; sometimes you will get multiple errors which are caused by one issue.
 
Once upon a time there were three bears. And they were visted by a golden haired tiny ad:
Java file APIs (DOC, XLS, PDF, and many more)
https://products.aspose.com/total/java
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!