GeezerVisonThe World Wide Web, restored to 800 pixels of glory. |
| Home|About|Gaming cabinet|Archives|How it works|Starter sites |
GeezerVison is showing github.com — JavaTutorial/src/F021_IfStatements.java at master · windweb/JavaTutorial Expand file tree/ Copy pathF021_IfStatements.javaMore file actions 43 lines (37 loc) · 1.09 KB / Copy pathF021_IfStatements.javaFile metadata and controls43 lines (37 loc) · 1.09 KB 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 /* If Statements / Условные операторы if if - оператор, который выполняет действие только если условие истинно if (условие) { действие } */ /* conditions.txt: If temp is greater than 30 It's a hot day Drink plenty of water Otherwise, if it's between 20 and 30 It's a nice day Otherwise It's cold */ /* условия.txt: Если температура больше 30 Это жаркий день Пейте много воды В противном случае, если она между 20 и 30 Это нормальный день В противном случае Это холодный */ public class F021_IfStatements { public static void main(String[] args) { int temp = 20; if (temp > 30) { System.out.println("It's a hot day"); System.out.println("Drink plenty of water"); } else if (temp < 20) System.out.println("It's cold"); else System.out.println("It's a nice day"); } } |
| You are visitor 01402503 — GeezerVison does not store the pages you look up. Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required. |