Advertisement
fahimkamal63

4.(b)

Jun 29th, 2019
185
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.59 KB | None | 0 0
  1. /**
  2.  * 4.(b)
  3.  * Date : 29.06.19
  4.  */
  5. package Batch10mid;
  6.  
  7. class array{
  8.     private int[] list = {10,20,30,40,50};
  9.     public void mystery(int[] array){
  10.         int tep = array[array.length - 1];
  11.         for(int i = 1; i < array.length; i++){
  12.             array[i] = array[i-1];
  13.         }
  14.         array[0] = tep;
  15.     }
  16.     void call(){
  17.         mystery(list);
  18.         for(int i = 0; i < list.length; i++){
  19.             System.out.print(list[i] + " ");
  20.         }
  21.     }
  22. }
  23.  
  24. public class ArrayList {
  25.    
  26.     public static void main(String[] args){
  27.         new array().call();
  28.         //ob.call();        
  29.     }
  30. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement