publicclassDemo04{publicstaticvoidmain(String[] args){printMax(34,3,3,2,56.5);printMax(newdouble[]{1,2,3});}publicstaticvoidprintMax(double... numbers){if(numbers.length ==0){System.out.println("no argument passed");return;}double result = numbers[0];for(int i =0; i < numbers.length; i++){if(numbers[i]> result){
result = numbers[i];}}System.out.println("The max value is :"+result);}}