Skip to Main Content

New to Java

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

strcpy in java ?

843785Aug 30 2008 — edited Aug 30 2008
Hi all,

I'd like to know how to sort strings in java. Usually in C I'd do something like this:

for(i=0;i<length-1;i++)
{
for(j=0;j<length;j++)
{
if(strcmp(name,name[j])>0)
{
strcpy(tmp,name[i]);
strcpy(name[i],name[j]);
strcpy(name[j],tmp);
}
}
}

I'd love to be able to do the same thing in Java, thanks in advance!
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Sep 27 2008
Added on Aug 30 2008
8 comments
2,333 views