1.
Public static void main(String[] args) {
string s = " 2008-09-06 ";
string buffer sb = new string buffer(); ;
string[]str = s . split("-");
for(int I = 0; I < string length; i++){
sb . append(str[I]);
}
system . out . println(sb . tostring());
}
2 . public static void main(String[]args){
Date d = new date ();
string buffer sb = new string buffer();
sb . append(d . get year()+ 1900);
sb . append(" 0 ");
sb . append(d . get month()+ 1);
sb . append(" 0 ");
sb . append(d . getday());
system . out . println(sb . tostring());
}
Both can be achieved.