Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public class ShiftRightForZane{
- public static void main(String []args){
- String[] toppings = {"Cheese", "Pepperoni", "Black Olives"};
- String temp = toppings[toppings.length-1];
- for(int i=toppings.length-1;i>=1;i--)
- {
- toppings[i] = toppings[i-1];
- }
- toppings[0]=temp;
- System.out.println(toppings[0]);
- System.out.println(toppings[1]);
- System.out.println(toppings[2]);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement