• 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
  • Paul Clapham
  • Ron McLeod
  • Jeanne Boyarsky
  • Tim Cooke
Sheriffs:
  • Liutauras Vilda
  • paul wheaton
  • Henry Wong
Saloon Keepers:
  • Tim Moores
  • Tim Holloway
  • Stephan van Hulst
  • Carey Brown
  • Frits Walraven
Bartenders:
  • Piet Souris
  • Himai Minh

What is wrong with this test code?

 
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
HI,

I'm new to java and learning from head first. It gave me a test code, but when I try to compile it, it gives errors.
Code:
---------------------

--------------------
Errors:
-----------------------------

------------------------------
Thank you for helping in advance!

[Edit: put code between [code] and [/code] ubb code blocks]
 
author and jackaroo
Posts: 12199
280
Mac IntelliJ IDE Firefox Browser Oracle C++ Java
  • Likes 2
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Albert,

Welcome to the Ranch.

It is not printIn (with a capital "i"), but println (with a lower-case "L").

So:
 
Albert Johnstone
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Andrew Monkhouse wrote:Hi Albert,

Welcome to the Ranch.

It is not printIn (with a capital "i"), but println (with a lower-case "L").

So:


Oh haha. My mistake, but I thought print in would make more sense ;) Thanks a lot for helping!
 
Bartender
Posts: 4568
9
  • Likes 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Albert Tarcy wrote:Oh haha. My mistake, but I thought print in would make more sense ;) Thanks a lot for helping!


println is short for print-line. It adds a line break at the end of whatever you print. There's also a print method, which omits the line break.
 
There are no more "hours", it's centi-days. They say it's better, but this tiny ad says it's stupid:
free, earth-friendly heat - a kickstarter for putting coin in your pocket while saving the earth
https://coderanch.com/t/751654/free-earth-friendly-heat-kickstarter
reply
    Bookmark Topic Watch Topic
  • New Topic