diff options
author | Aaryan Rampal <76913929+aaryan-rampal@users.noreply.github.com> | 2023-12-14 06:54:25 -0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-12-14 15:54:25 +0100 |
commit | 9f317de120e8ad02ff47e3ad976bd69391efcada (patch) | |
tree | a1738e9430bd7bf8d17578438ecf06f5141a0eab | |
parent | 0179b04111f28c57f4c23335c57336629fede68e (diff) |
[java/en] Update java.html.markdown (#4079)
* Update java.html.markdown
java/en
* Update java.html.markdown
---------
Co-authored-by: jus78help <76913929+jus78help@users.noreply.github.com>
-rw-r--r-- | java.html.markdown | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/java.html.markdown b/java.html.markdown index 6003f8ef..7bf3fa0a 100644 --- a/java.html.markdown +++ b/java.html.markdown @@ -126,6 +126,9 @@ public class LearnJava { // <name1> = <name2> = <name3> = <val> int barInt1, barInt2, barInt3; barInt1 = barInt2 = barInt3 = 1; + // Shorthand for multiple declarations + int barInt4 = 1, barInt5 = 2; + /* * Variable types @@ -307,8 +310,8 @@ public class LearnJava { /////////////////////////////////////// System.out.println("\n->Operators"); - int i1 = 1, i2 = 2; // Shorthand for multiple declarations - + int i1 = 1, i2 = 2; + // Arithmetic is straightforward System.out.println("1+2 = " + (i1 + i2)); // => 3 System.out.println("2-1 = " + (i2 - i1)); // => 1 |