Win a copy of Mesos in Action this week in the Cloud/Virtualizaton forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

"Cannot Find Symbol" error

 
Ben Drx
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello,

I'm just starting out with Java, I took a class years ago (1.1) and then never touched it again. My only other programing experience is with VB6, but just use it for little things.

My Problem:

When compiling my files "Default.java" I get the error "Cannot Find Symbol" with a carrot pointing to the first "." in System.Out.Println.

I've tried importing Java.io.* hoping it might be included in that package. All the samples I've looked at for the last hour look just like mine or at least the same general mechanics. I starting copying a sample from my Headstart book, and then one from my reference book, finally i dumbed it down to this:

public class Default {
public static void main(String args[])

{
System.Out.PrintLn("Blah blah blah!!!");
}
}

Any help would be greatly appreciated. I'm assuming I don't have part of the JDK set up right. NetBeans gives me the same problems as well. I have 1.5.0, upgrade 7 installed for both JDK and JVM. Sorry if i'm too long winded.

Thanks,
Ben
 
Saket Barve
Ranch Hand
Posts: 229
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Ben,

Java is case-sensitive!



Is this the way you have it in your code too or is this just a typo while posting the message on the forum here?

Saket
 
marc weber
Sheriff
Posts: 11343
Java Mac Safari
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Welcome to JavaRanch!

Just to expand on what Saket already pointed out...

The convention in Java is to capitalize the first letter of class names (like "System," which is a class in java.lang), but use lowercase for the first letter of variables (like "out," which is a variable in the System class) and methods (like "println," which is a method in the PrintStream object referenced by "out").
 
Ben Drx
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You guys are the greatest. I did play with caps trying to get it too work but I always went from all caps and all lower. Thank you, thank you, thank you and thanks. I spent way too much time with this last night and had null sucess.

Thanks,
Ben
 
marc weber
Sheriff
Posts: 11343
Java Mac Safari
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Ben Drx:
... All the samples I've looked at for the last hour look just like mine or at least the same general mechanics...

Be careful with: "the same general mechanics." This implies an assumption that the differences shouldn't matter, when it's clear that something is causing a problem.
[ July 02, 2006: Message edited by: marc weber ]
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic