Results 1 to 3 of 3
  1. #1
    NewbieDan is offline Member
    Join Date
    Oct 2011
    Posts
    7
    Rep Power
    0

    Default The "New" operator?

    Please Delete.. Stupid question
    Last edited by NewbieDan; 10-07-2011 at 01:35 AM.

  2. #2
    mine0926 is offline Senior Member
    Join Date
    Apr 2010
    Location
    Philippines
    Posts
    580
    Rep Power
    4

    Default Re: The "New" operator?

    Do not delete your post. If you find the answer, you can reply into it and tell where you find it and explain what you have understand.

  3. #3
    NewbieDan is offline Member
    Join Date
    Oct 2011
    Posts
    7
    Rep Power
    0

    Default Re: The "New" operator?

    Okay,

    The question was basically, what's the difference between

    String title;
    title = new String ("hello");

    and

    String title;
    title = ("hello");

    I was just confused why my textbook was showing me the first way when the second way works just fine. It later mentioned the second way and said it was fine to only use it that way.

    If I understand correctly, only the String class can work in this way and every other class requires the "new operator"... Correct?
    Last edited by NewbieDan; 10-07-2011 at 09:02 AM.

Similar Threads

  1. "Best" implementation of math operator methods?
    By rgrant222 in forum New To Java
    Replies: 2
    Last Post: 09-01-2010, 07:47 AM
  2. Java, Military Format using "/" and "%" Operator!!
    By sk8rsam77 in forum New To Java
    Replies: 11
    Last Post: 02-26-2010, 03:03 AM
  3. " shift " Operator ???
    By MuslimCoder in forum New To Java
    Replies: 5
    Last Post: 02-09-2009, 05:51 AM
  4. Replies: 2
    Last Post: 01-24-2009, 06:56 PM
  5. Replies: 1
    Last Post: 10-20-2008, 07:35 AM

Posting Permissions

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