Advertisement
Guest User

Untitled

a guest
Apr 26th, 2019
70
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.52 KB | None | 0 0
  1. import java.util.Scanner;
  2.  
  3. public class leftShift{
  4.  
  5. public static void main(String[] args){
  6.  
  7. double [] array= new double[10];
  8.  
  9. System.out.println(shift(array));
  10. }//end of main
  11.  
  12. public static double shift(double array[]){
  13. double newArray = array[0];
  14. double temp;
  15.  
  16. temp = array[0];
  17. for(int i=0; i < array.length-1; i++){
  18. newArray = array[i + 1];
  19.  
  20. }//end of for loop
  21.  
  22. return newArray;
  23. }//end of shift method
  24.  
  25. }//end of class
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement