• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

How to align in java

 
puni doms
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Can anyone help me to write a code in java applet 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
Bartender
Posts: 2839
46
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 3742
16
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
puni doms wrote:can you tell , in which code the answer willl come.

Did you read the second part of Tim's post ?
 
Darryl Burke
Bartender
Posts: 5132
11
Java Netbeans IDE Opera
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Nothing specific to Applets. I'm moving this thread to Beginning Java.
 
Darryl Burke
Bartender
Posts: 5132
11
Java Netbeans IDE Opera
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Please BeForthrightWhenCrossPostingToOtherSites
http://www.java-forums.org/new-java/55201-how-align-java.html
 
fred rosenberger
lowercase baba
Bartender
Posts: 12143
30
Chrome Java Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.

 
Campbell Ritchie
Sheriff
Pie
Posts: 49379
62
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
And welcome to the Ranch
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic