What Boolean do i need? or how do i need it??? | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 2

What Boolean do i need? or how do i need it???

/** * * Beschreibung * * @version 1.0 vom 05.10.2017 * @author */ import java.util.Scanner; public class MaxMin { public static void main(String[] args) { Scanner reader = new Scanner(System.in); int zahl_1; int zahl_2; int zahl_3; boolean vergleich = true; System.out.println("Bitte geben sie eine Zahl ein"); zahl_1 = reader.nextInt(); System.out.println("Bitte geben sie eine 2te Zahl ein"); zahl_2 = reader.nextInt(); System.out.println("Bitte geben sie eine 3te Zahl ein"); zahl_3 = reader.nextInt(); if (zahl_1 <= zahl_2 && zahl_3) { System.out.println("Maximum \n" + zahl_1); } // end of if if (zahl_1 >= zahl_2 && zahl_3) { System.out.println("Minimum \n" + zahl_1); } // end of if } // end of main } // end of class MaxMin //Its all on german, i need to make a programm that can sort 3 different Numbers from Maximum to Minimum (from highest to lowest Number). Can someone help me? Sorry for my English..

5th Oct 2017, 7:36 PM
Sebastian
Sebastian - avatar
2 Answers
+ 1
Booleans are True/False values. If True, something executes, else it doesn't
5th Oct 2017, 10:53 PM
👑 Prometheus 🇸🇬
👑 Prometheus 🇸🇬 - avatar
0
where is "else"?
26th Dec 2017, 11:02 AM
Tleichs Tiago Sonna Leichsenring
Tleichs Tiago Sonna Leichsenring - avatar