Dennis Thomas

Greenhorn
+ Follow
since Sep 07, 2009
Cows and Likes
Cows
Total received
0
In last 30 days
0
Total given
0
Likes
Total received
0
Received in last 30 days
0
Total given
0
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by Dennis Thomas

Hi all,

i inquired about Sun Java voucher and people said current price of the voucher is Rs.6500/- Can someone help me finding one for cheaper price. I am located in New Delhi, India.
I agree with Hunter and his approach. Recursion can be used for reversing the string



after this you can equate both the strings and check if they are same.
12 years ago
Thanks ankit. you can save your time too, if you read the thread properly.
The answer is one. The source of the question is Sun Certified Programmer for Java 6, Kathy Seirra, Bert Bates from Chapter 3. Sorry for the indentation.
instead of sentence.replaceAll("\b" + oldWord + "\b", newWord); use

sentence.replaceAll("\\b" + oldWord + "\\b", newWord);
12 years ago

How many Objects would be eligible for garbage collection when it reaches line 16 and which one and how?

3. class Beta { }
4. class Alpha {
5. static Beta b1;
6. Beta b2;
7. }
8. public class Tester {
9. public static void main(String[] args) {
10. Beta b1 = new Beta(); Beta b2 = new Beta();
11. Alpha a1 = new Alpha(); Alpha a2 = new Alpha();
12. a1.b1 = b1;
13. a1.b2 = b1;
14. a2.b2 = b2;
15. a1 = null; b1 = null; b2 = null;
16. // do stuff
17. }
18. }