Results 1 to 2 of 2

Thread: String error

  1. #1
    Jlin787 is offline Member
    Join Date
    Jan 2009
    Posts
    1
    Rep Power
    0

    Default String error

    So in my code for my class I have to define String for homework.
    I put in
    String stringOne = hello world;
    I have been trying to figure this error out and I still can't figure it out.

  2. #2
    CJSLMAN's Avatar
    CJSLMAN is offline Moderator
    Join Date
    Oct 2008
    Location
    Mexico
    Posts
    1,159
    Rep Power
    7

    Default Strings..

    Strings in Java have to have quotes around them:
    Java Code:
    String stringOne = [B][COLOR="blue"]"[/COLOR][/B]hello world[B][COLOR="Blue"]"[/COLOR][/B];
    Luck,
    CJSL
    Chris S.
    Difficult? This is Mission Impossible, not Mission Difficult. Difficult should be easy.

Similar Threads

  1. [SOLVED] String out of bound error
    By maxb in forum New To Java
    Replies: 4
    Last Post: 12-01-2008, 02:32 PM
  2. Replies: 2
    Last Post: 09-18-2008, 07:30 AM
  3. Cannot convert from char to String error
    By sondratheloser in forum New To Java
    Replies: 1
    Last Post: 12-13-2007, 09:28 PM
  4. Error: cannot be applied to (java.lang.String)
    By carl in forum New To Java
    Replies: 1
    Last Post: 08-05-2007, 06:33 AM
  5. Error: convert from String to long
    By bbq in forum New To Java
    Replies: 1
    Last Post: 06-29-2007, 07:23 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •