Can anyone help me to write a code in javaapplet in eclipse
For eg: If you have English 1
Hindi2
English 4
Hindi1
English 2
Hindi4
English 3
Hindi3
And the answer must be English 1
English 2
English 3
English 4
Hindi1
Hindi2
Hindi3
Hindi4
Tim Moores
Rancher
Joined: Sep 21, 2011
Posts: 2329
posted
1
I think you mean "sorting", not "aligning", yes?
Depends on the kind of data structure you're using to store these. If it's String objects in a java.util.List (like an ArrayList), you could simply call Collections.sort(...).
puni doms
Greenhorn
Joined: Feb 06, 2012
Posts: 6
posted
0
The same what the above is.....
i dont knoe wheather it sort or align....
can you tell , in which code the answer willl come.
Joanne Neal
Rancher
Joined: Aug 05, 2005
Posts: 2686
posted
0
puni doms wrote:can you tell , in which code the answer willl come.
An example is not a spec. It may be enough to start the conversation, but it is a LONG way from defining what needs to be done. It is not clear if you are sorting the list of inputs alphabetically, if English must always come first (what if instead of Hindi it was Arabic - should English still come first?), if the first language listed should come first, or something else entirely.
Never ascribe to malice that which can be adequately explained by stupidity.