Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

Java Java Basics Getting Started with Java Strings, Variables, and Formatting

Derrick Bonner
PLUS
Derrick Bonner
Courses Plus Student 65 Points

During challenge task 1 I enter string firstName = "Derrick"; but keep getting a error saying cannot find symbol.??

javaTester. java:53: error: cannot find symbol

Name.java
// I have setup a java.io.Console object for you named console
string firstName = "Derrick";
Dylan Espey
Dylan Espey
10,578 Points

I believe "string" needs to be capitalized. So...

String firstName = "Derrick";

It's one of the weird exceptions in Java.

4 Answers

William Li
PLUS
William Li
Courses Plus Student 26,868 Points

No, it's not weird. Java has 8 primitive data types.

  1. byte
  2. short
  3. int
  4. long
  5. float
  6. double
  7. boolean
  8. char

they are all in lower-capped.

though it's used very frequently, String isn't one of the primitive data type, String is a built-in class, and the code convention in Java is that class name begins with its first letter capitalized.

Ken Alger
STAFF
Ken Alger
Treehouse Teacher

Derrick;

Welcome to Treehouse!

I wrote a little bit about the Cannot Find Symbol error on this post. You might take a look for your own future knowledge and Java errors.

Ken

Rob Bridges
seal-mask
.a{fill-rule:evenodd;}techdegree seal-36
Rob Bridges
Full Stack JavaScript Techdegree Graduate 35,467 Points

Hello, java is very weird about its character types. As the comment suggests just capitalize String. Should do the ticket.

Let me know if this helps.