Programming - String Buffers
You Are Here :: Home > JAVA > String Buffers - General Questions
19. |
StringBuffer sb=new StringBuffer("New Delhi");
String s=sb.substring(4);
In the above,from where to where the substring is formed.
|
A. |
only 4th position string |
B.
|
from 4th to till end |
C.
|
from first to last
|
D.
|
none
|
|
Answer: Option B
Explanation:
Here New Delhi is the String.from 4th position the substring is formed untill last. |
|
20. |
String substring(int I,int j).this extract the sub string from?
|
A. |
int I to j |
B.
|
from 0 to int j |
C.
|
from I to j-1
|
D.
|
from i-1 to j
|
|
Answer: Option C
Explanation:
from I to j-1 we can extract the substring. |
|
21. |
The String which gives same string even after reversing is _____________
|
A. |
palindrome |
B.
|
polinomial |
C.
|
both
|
D.
|
none
|
|
Answer: Option A
Explanation:
Palindrome is nothing but the string which gives same string even after reversing. |
|
22. |
Is StringBuilder class can be changed or not mutable?
|
A. |
yes |
B.
|
no |
C.
|
Cant say
|
D.
|
none
|
|
Answer: Option A
Explanation:
Yes,StringBuilder can be changed. |
|
23. |
To lock the object the method is _________________
|
A. |
synchronizing |
B.
|
StringBuilder |
C.
|
serializing
|
D.
|
none
|
|
Answer: Option A
Explanation:
synchronizing is the method to lock the objects. |
|
24. |
Is StringBuilder can be synchronized or not?
|
A. |
yes |
B.
|
no |
C.
|
Cant say
|
D.
|
none
|
|
Answer: Option B
Explanation:
StringBuilder cannot be synchronized. |
|
« prev
next »