This week's book giveaways are in the Refactoring and Agile forums.
We're giving away four copies each of Re-engineering Legacy Software and Docker in Action and have the authors on-line!
See this thread and this one for details.
Win a copy of Re-engineering Legacy Software this week in the Refactoring forum
or Docker in Action in the Cloud/Virtualization forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

The . that I type and copied . are different?

 
Tony Jin
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello everyone, this is my first post!
Well I just started java and came across a weird problem.

For the command that I copied from the tutorial website (only the system.out.printin)
System.out.println ("This is " + loopcount + " number");

it gets an error if I type this myself.
System.out.printIn ("This is " + loopcount + " number");

The errors comes out pointing at the dot saying "cannot find symbol". Is something wrong with my keyboard or something?

I am utterly confused
 
Paul Clapham
Sheriff
Pie
Posts: 20756
30
Eclipse IDE Firefox Browser MySQL Database
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Well, yes. Look more carefully at the difference between

print-l-n

and

print-I-n

It also helps if you realize that the method "prints" a "line".
 
Amit Ghorpade
Bartender
Posts: 2854
10
Fedora Firefox Browser Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Tony Jin welcome to Javaranch
As said by Paul, the problem is with the "I" actually is small letter "l" (as in look). And Java is case sensitive.

The errors comes out pointing at the dot saying "cannot find symbol". Is something wrong with my keyboard or something?

The error is shown at the .(dot) because the compiler can resolve the System and the out object but cannot resolve the "printIn" method since there is no such method.
When you see errors like those, first thing to check is typing mistakes, then syntax errors and finally if the variable or method pointed by the error message is really available at that point.

Hope this helps
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic