Forums
New posts
Search forums
Members
Current visitors
Log in
Register
What's new
Search
Search
Search titles only
By:
New posts
Search forums
Menu
Log in
Register
Install the app
Install
Forums
Programming Languages
Java
How to sort a CSV file with merge sort JAVA
JavaScript is disabled. For a better experience, please enable JavaScript in your browser before proceeding.
You are using an out of date browser. It may not display this or other websites correctly.
You should upgrade or use an
alternative browser
.
Reply to thread
Message
[QUOTE="CodeMonkeyJ, post: 5168466, member: 86802"] The easiest way to compare two primitive ints would be: [CODE=java]Integer.compare(a.marks, b.marks);[/CODE] So, just copy the nameCompare class to marksCompare and update the return line. The only problem I see is the split: [CODE=java]String[] studentDetail = currentLine.split("");[/CODE] This will split a line on every character, so studenDetail[1] will be the second character, not the second field. Just switch it to: [CODE=java]String[] studentDetail = currentLine.split(",");[/CODE] [/QUOTE]
Verification
Post reply
Forums
Programming Languages
Java
How to sort a CSV file with merge sort JAVA
Top