Comment trouver la valeur maximale de l'ensemble des variables

Je me demandais si quelqu'un pourrait m'aider à trouver la valeur maximale d'un ensemble de variables et de les affecter à une autre variable. Voici un extrait de mon code qui peut les aider à comprendre de quoi je parle.

//Ask for quarter values.
    System.out.println("What is the value of the first quarter?");
    firstQuarter = input.nextDouble();

    System.out.println("What is the value of the second quarter?");
    secondQuarter = input.nextDouble();

    System.out.println("What is the value of the third quarter?");
    thirdQuarter = input.nextDouble();

    System.out.println("What is the value of the fourth quarter?");
    fourthQuarter = input.nextDouble();

    //Tell client the maximum value/price of the stock during the year.     
    //maxStock = This is where I need help 
    System.out.println("The maximum price of a stock share in the year is: $" + maxStock + ".");

source d'informationauteur Cody Bennett | 2012-02-16