O. Ziggy wrote:I actually got this wrong because i thought compilation would fail because of the command line.
i thought that the \d would have required an additional escape character. i.e. it should have been \\d
Anjali Vaidya wrote:why doesn't it print "Super" then?
Can anybody please write the line number it goes to step by step?
The object reffered to by the reference variable "two" was created using the new keyword. As it is not refered to from the constant pool, what provides its immutability?
I actually thought that since one of the elements in the expression is a string, the + operator will be used for concatenating.
Stephan van Hulst wrote:I very rarely use inheritance myself, but was it a mistake to add it to the language, because so many new programmers misuse it?
And also, since s1 == s4 is false, does not mean that strings created using the new keywork are not placed in the pool?
Sudhanshu Mishra wrote:Hi all,
Please have a look at my question.
I need to understand it urgently.
Eagerly waiting for the answer....
Darryl Burke wrote:
Catherine austin wrote:Since final object ...
Hold it right there. Objects aren't ever final. Variables can be.
Matthew Brown wrote:You're probably right - I misunderstood the question.
In which case, the answer is "because Integers are immutable".