New Member FAQ | Forums | Earn Revenue


Resources Entrance Ask Experts Exam Papers Jobs English Projects Universities Colleges Courses Schools Training My India



My Profile
Active Members
TodayLast 7 Days more...



Awards & Gifts
Online Exams

Fresher Jobs


Our fresher job section is exclusively for fresh graduates! Find jobs for freshers in major Indian cities including Bangalore, Chennai, Hyderabad, Pune or Kochi

Resources


Find educational articles, blogs, discussion threads and other resources.

Colleges


Find details about any college in India or search for courses.

website counter



Java program to sort a given list of names in ascending order


Posted Date:     Total Responses: 0    Posted By: Sunil Reddy   Member Level: Platinum   Points/Cash: 4   


import java.lang.*;
import java.io.*;
import java.util.*;
class Sort
{
public static void main(String arg[ ]) throws IOException
{
DataInputStream dis=new DataInputStream(System.in);
System.out.println("enter the size");
int n=Integer.parseInt(dis.readLine());
String array[ ]=new String[n];
System.out.println("enter names");
for(int i=0;i{
array[i]=dis.readLine();
}
for(int i=0;i{
for(int j=0;j{
if(array[j].compareTo(array[j+i])>0)
{
String temp=array[j];
array [j]=array[j+1];
array[j+1]=temp;
}
}
}
System.out.println("the sorted strings are");
for(int i=0;iSystem.out.println(array[i]);
}
}


Project Feedbacks


No feedbacks found. Be the first to respond and make money from revenue sharing program.

Post Feedback
You must Sign In to post a feedback.
Next Project: Java program that checks whether the given string is palindrome or not
Previous Project: Java program to multiply two given matrices

Return to Project Index

Post New Project


Related Projects



Advertise Here





Contact Us   Advertise   Editors    Privacy Policy    Terms Of Use   

ISC Technologies.
2006 - 2009 All Rights Reserved.