Anayonkar Shivalkar wrote: . . . UseCodeTags . . . .
Since you are new, I have added the code tags for you and you can see how much better the post looks. Unfortunately, it highlights incorrect indentation, so you can’t tell just by looking which
else corresponds to which
if (...). Also,
you should use
spaces for indenting, not tabs. You also have a design problem; the main method is not intended to hold lots of code like that. I know some books show code like that, but it doesn’t teach you object‑oriented design.
If you are using Java7, you can use a
switch-case with "a" "A" "b" "B" etc. as its cases.
Why are you using capital letters to start local variable names?
Why have you got Start++ as the initialisation of a
for statement? That looks like very peculiar design. You should code
for loops to match
this example whenever possible.
Also, provided the variables stay in scope, it is probably better style to declare them as late as possible, which would be where they are initialised from the Scanner.
It is completely unnecessary to enclose your loops in those
if(...) statements.
You can use this sort of loop to iterate an array backwards