Yogesh's Blog

Sharing me with blog…
Archive for October, 2010

October 25th, 2010

XMLGregorianCalendar to Date

No Comments, Java, by Yogesh.

Way to get Date object from XMLGregorianCalender object. Suppose XMLGregorianCalender object is xmlGregCal To get date object, write following statement: xmlGregCal.toGregorianCalendar().getTime()

October 25th, 2010

16 characters random code

No Comments, Java, by Yogesh.

In java, there is a vary simple way to generate 16 characters random code. All you need to do is : write this statement: Long.toHexString(Double.doubleToLongBits(Math.random())) This will return you 16 char random code.