Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import java.util.Scanner;
- public class leftShift{
- public static void main(String[] args){
- double [] array= new double[10];
- System.out.println(shift(array));
- }//end of main
- public static double shift(double array[]){
- double newArray = array[0];
- double temp;
- temp = array[0];
- for(int i=0; i < array.length-1; i++){
- newArray = array[i + 1];
- }//end of for loop
- return newArray;
- }//end of shift method
- }//end of class
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement