Java Program 09: Printing Words In Circular Order From Given Index

Hello Folks,

This is frequently asked interview question.


Suppose you have below string:

“Make Selenium Easy” Where

-“Make” is at position zero.
-“Selenium” is at first position .
-“Easy” is at second position .

If I say:

-zero, You need to print “Make Selenium Easy”.
-one, you need to print “Selenium Easy Make”.
-two, you need to print “Easy Selenium Make”.

Accept string and position from user.




Program is self descriptive. I have put required comments as well. If you have nay doubt, feel free to comment.


Author: Amod Mahajan

My name is Amod Mahajan and I am an IT employee with 6+ years of experience in Software testing and staying in Bengaluru. My area of interest is Automation testing. I started from basics and went through so many selenium tutorials. Thanks to Mukesh Otwani as his tutorials are easy and cover basics to advance. I have habit of exploring concepts by deep diving. I used to make notes. I thought of sharing my knowledge through posts and now I am here. #KeepLearning #ShareLearning