Programming - String Buffers
You Are Here :: Home > JAVA > String Buffers - General Questions
7. |
StringBuffer sb=new StringBuffer("New Delhi");
String s=sb.substring(4);
In the above,from where to where the substring is formed.
|
A. |
6 characters |
B.
|
8 characters |
C.
|
Maximum
|
D.
|
null
|
|
Answer: Option A
Explanation:
It occupies only 6 characters |
|
8. |
The method used for inserting the string is ?
|
A. |
StringBuffer insert(int I,int X) |
B.
|
StringBuffer insert(int I,X) |
C.
|
StringBuffer insert(I,int X)
|
D.
|
StringBuffer insert(I,X)
|
|
Answer: Option D
Explanation:
syntax for inserting the string. |
|
9. |
To add the String to StringBuffer class the method used is ______________________?
|
A. |
StringBuffer append(X); |
B.
|
StringBuffer append(); |
C.
|
StringBuffer Append()
|
D.
|
StringBuffer Append(X)
|
|
Answer: Option A
Explanation:
StringBuffer append(X); is used to add the string to string buffer class |
|
10. |
The method used for deleting the string is ?
|
A. |
StringBuffer delete(int I,int j) |
B.
|
StringBuffer delete(I,j) |
C.
|
StringBuffer delete(int I,j)
|
D.
|
StringBuffer delete(I,int j)
|
|
Answer: Option A
Explanation:
StringBuffer delete(int I,int j) is used for deleteing the string. |
|
11. |
Synchronizing mechanism is used for objects ________________
|
A. |
locking and unlocking |
B.
|
locking |
C.
|
unlocking
|
D.
|
none
|
|
Answer: Option B
Explanation:
Synchronizing mechanism is used for objects locking. |
|
12. |
which is faster execution one?
|
A. |
StringBuilder |
B.
|
StringBuffer |
C.
|
both
|
D.
|
none
|
|
Answer: Option A
Explanation:
StringBuilder is faster execution one than StringBuffer. |
|
« prev
next »