0

Java basics question involving sorting and conditional statements

I cannot figure how to finish my program... import javax.swing.JOptionPane; public class Program { public static void main(String[] args) { String num1String = JOptionPane.showInputDialog( " Enter a number :"); String num2String = JOptionPane.showInputDialog( " Enter a number :"); String num3String = JOptionPane.showInputDialog( " Enter a number :"); int num1 = Integer.parseInt(num1String); int num2 = Integer.parseInt(num2String); int num3 = Integer.parseInt(num3String); // THis is the condition I want if ( num1 <= num2 <= num3) { } else // Here I want the program to sort so that my condition will be right }

11th Jun 2019, 7:13 PM
Markie Alicia
Markie Alicia - avatar
1 Réponse
+ 1
if ( num1 <= num2 && num2 <= num3) {
11th Jun 2019, 8:14 PM
zemiak