Friday, January 15, 2016

Program On Rearranging The Word BlueJ


In this BlueJ program, the word BLUEJ will be displayed in different rearranged form like:

BLUEJ
LUEJB
UEJBL
EJBLU
JBLUE

Download eBook on BlueJ 

class Jav
{
 String s="BLUEJ";
 int x,i,j,len;
 void show()
 {
  len=s.length();
  for(i=0;i< len;i++)
  {
   x=i;
   for(j=0;j< len;j++)
   {
       System.out.print(s.charAt(x));
    x++;
    if(x==len)
    x=0;
    }
    System.out.println();
    }
    }
    public static void main(String args[])
    {
     Jav ob=new Jav();
     ob.show();
     }
     }

No comments:

Post a Comment

Subscribe via email

Enter your email address:

Delivered by FeedBurner