Results 1 to 3 of 3
Thread: The "New" operator?
- 10-07-2011, 01:29 AM #1
Member
- Join Date
- Oct 2011
- Posts
- 7
- Rep Power
- 0
- 10-07-2011, 02:29 AM #2
Senior Member
- Join Date
- Apr 2010
- Location
- Philippines
- Posts
- 580
- Rep Power
- 4
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.
- 10-07-2011, 09:00 AM #3
Member
- Join Date
- Oct 2011
- Posts
- 7
- Rep Power
- 0
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
-
"Best" implementation of math operator methods?
By rgrant222 in forum New To JavaReplies: 2Last Post: 09-01-2010, 07:47 AM -
Java, Military Format using "/" and "%" Operator!!
By sk8rsam77 in forum New To JavaReplies: 11Last Post: 02-26-2010, 03:03 AM -
" shift " Operator ???
By MuslimCoder in forum New To JavaReplies: 5Last Post: 02-09-2009, 05:51 AM -
MoneyOut.println("It took you (whats wrong?>",year,"<WW?) years to repay the loan")
By soc86 in forum New To JavaReplies: 2Last Post: 01-24-2009, 06:56 PM -
the dollar sign "$", prints like any other normal char in java like "a" or "*" ?
By lse123 in forum New To JavaReplies: 1Last Post: 10-20-2008, 07:35 AM


LinkBack URL
About LinkBacks
Reply With Quote
Bookmarks