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

ICSE Class 9 Computer Applications Notes: Values, Data Types and Operators in Java
Easy-to-revise ICSE Class 9 Computer Applications notes on Java tokens, primitive data types, type conversion, and arithmetic, relational, logical, increment and ternary operators, with solved output questions and practice exercises.

ICSE Class 10 Computer Applications Sample Paper 2027 with Solutions
A full-length ICSE Class 10 Computer Applications sample paper for the 2027 board exam in the latest CISCE format: 20 MCQs, 10 short-answer questions and 6 Java programs, followed by complete solutions with explanations and solved BlueJ programs.
ICSE computer applications sample paper
ICSE computer applications sample paper (Set 3): ICSE Class 10 Computer Applications sample paper with important questions for computer exam practice.