Как найти максимальное значение множества переменных

Мне было интересно, может ли кто-нибудь помочь мне найти максимальное значение набора переменных и назначить их другой переменной. Вот фрагмент моего кода, который может помочь понять, о чем я говорю.

// 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 + ".");

Ответы на вопрос(8)

Ваш ответ на вопрос