Hi all!
I have a doubt regarding the Exercise Ques.in KAM 10.23(Pg:321).
10.23) Which of these parameter lists have a
corresponding constructor in the StringBuffer
class?
a) ()
b) (int capacity)
c) (char[] data)
d) (
String str)
answer given in the book is
(a),(b) and (d)
The StringBuffer class does not have a constructor
that takes an array of char as a parameter.
My doubt is:
Doesn't the overloaded method append() of StringBuffer
class has a signature as follows:
StringBuffer append(char[] str)
It is also given in the KAM (Pg:318) under the section
Appending, Inserting, and Deleting Characters in String Buffers.
Is the answer given wrong? Should not it be
(a),(b),(c)and(d).
Please clarify.
Thanks in advance!
Meenakshi