Amit Singla

Greenhorn
+ Follow
since Jun 20, 2008
Merit badge: grant badges
For More
Cows and Likes
Cows
Total received
In last 30 days
0
Forums and Threads

Recent posts by Amit Singla

exception StringBuilder's methods are synchronized.



It's StringBuffer whose methods are synchronized.
If you see, both the times are same the only difference is the default value of timezone.

Please see this... http://java.sun.com/javase/timezones/.. java guys talk about this thing. I think 2007 onwards there are standard days when Daylight saving will be done so java compute the time zone (with daylight saving) based on these rules. In your programme, if yoy change the month to 12 (from 10)... you will start seeing time in -8:00 hrs.
15 years ago
I thought of the same reaons but then at the same time they do allow inner classes in interface though i have never seen this feature in use.
15 years ago
I am not sure about in context to the SCJP but following are the major difference

String are Immutable objects which means they are final instances and value can not be changed.

StringBuffer and StringBuilder are better choises to String objects if the you have to make a string on the run. i.e. you have to concatenate
various string objects dynamically.

StringBuffer is thread safe but StringBuilder is not thread safe. So if you have a single thread environment, StringBuilder will give you better
performance over StringBuffer.
Interfaces do not allow static blocks but do allow public final static member.
If someone wants to initialize the variable based on some logic, it is not possible in interfaces but possible in classes.

I am trying to figure out the logical reson why java language does not allow it? though it allows to define inner classes in interface.
15 years ago
I am sorry for the same. Actually i was posting for the first time and was not aware of few things.

I will take care from next time.
15 years ago
i know i am very late in the reply but i came across this problen just now.
below is the programme to do the task. copy it and run it
-----------------------------------------------------------------
package com.test;

import java.util.regex.Pattern;

public class Roman2Decimal
{
DELETED. CR
}
[ June 20, 2008: Message edited by: Campbell Ritchie ]
16 years ago