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/F009_ArithmeticExpressions.java at master · windweb/JavaTutorial Expand file tree/ Copy pathF009_ArithmeticExpressions.javaMore file actions 31 lines (24 loc) · 842 Bytes / Copy pathF009_ArithmeticExpressions.javaFile metadata and controls31 lines (24 loc) · 842 Bytes 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 public class F009_ArithmeticExpressions { public static void main(String[] args) { int result1 = 10 / 3; System.out.println(result1); // result = 3 double result2 = (double) 10 / (double) 3; System.out.println(result2); // result2 = 3.3333333333333335 int x = 1; x++; // x = x + 1 // ++x; // x = x + 1 System.out.println(x); // x = 2 int y = x++; System.out.println(y); // ++x; отличается от x++; // переменная x не увеличивается, а просто увеличивается int z = 10; System.out.println(z); int w = ++z; System.out.println(z); int t = z++; System.out.println(z); System.out.println(w); System.out.println(t); } } |
| 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. |