A gripping String Bubble sort array program in java
String Bubble sort array program in Java: solved Java program for ICSE Class 10 Computer Applications with complete BlueJ code, explanation and sample output.
Design a program to create an array of strings, size should be entered by the user(between 5 to 20). And sort the string array in ascending order using the Bubble sort technique.
For more programs
An excellent String program to count words start and end with a vowel
import java.util.*;
class StringLinearSearch
{
public static void main()
{
Scanner sc=new Scanner(System.in);
System.out.println("Enter the size of array between 5 to 20");
int n=sc.nextInt();
String list[]=new String[n];
for(int i=0;i<n;i++)
{
System.out.println("Enter words");
list[i]=sc.next();
}
int len=list.length;
for(int i=0;i<len-1;i++)
{
for(int j=0;j<len-1-i;j++)
{
if((list[j].compareTo(list[j+1]))>0)
{
String temp=list[j];
list[j]=list[j+1];
list[j+1]=temp;
}
}
}
System.out.println("Sorted array");
for(int i=0;i<len;i++)
{
System.out.println(list[i]);
}
}
}Output:
Enter the size of array between 5 to 20
5
Nadiad
Madras
Bombay
Chennai
Agartala
Sorted array:
Agartala
Bombay
Chennai
Madras
Nadiad
For java videos click
https://www.youtube.com/user/trushna.tej
Related Posts
Continue learning with these related articles

String Methods in Java for ICSE Class 10: 25 Output Questions with Answers
ICSE Class 10 Computer Applications practice on String class methods: length, charAt, indexOf, lastIndexOf, substring, replace, trim, compareTo, equals and more, with 25 board-style output questions and step-by-step answers.

Special Number Programs in Java for ICSE: Armstrong, Spy, Neon, Disarium, Pronic and More
Every special number asked in ICSE Computer Applications – prime, perfect, Armstrong, palindrome, automorphic, neon, spy, Niven, duck, buzz, Disarium, special and pronic numbers – with definitions, examples and one complete Java program that checks them all.

Math Library Methods in Java for ICSE Class 9 (with Outputs)
ICSE Class 9 Computer Applications notes on the Java Math class: sqrt, cbrt, pow, abs, max, min, ceil, floor, round, rint and random, with return types, tricky negative-number outputs and Java expressions for formulas.