mirror of
https://github.com/adambard/learnxinyminutes-docs.git
synced 2025-08-09 08:16:58 +02:00
[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>
This commit is contained in:
@@ -126,6 +126,9 @@ public class LearnJava {
|
|||||||
// <name1> = <name2> = <name3> = <val>
|
// <name1> = <name2> = <name3> = <val>
|
||||||
int barInt1, barInt2, barInt3;
|
int barInt1, barInt2, barInt3;
|
||||||
barInt1 = barInt2 = barInt3 = 1;
|
barInt1 = barInt2 = barInt3 = 1;
|
||||||
|
// Shorthand for multiple declarations
|
||||||
|
int barInt4 = 1, barInt5 = 2;
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Variable types
|
* Variable types
|
||||||
@@ -307,7 +310,7 @@ public class LearnJava {
|
|||||||
///////////////////////////////////////
|
///////////////////////////////////////
|
||||||
System.out.println("\n->Operators");
|
System.out.println("\n->Operators");
|
||||||
|
|
||||||
int i1 = 1, i2 = 2; // Shorthand for multiple declarations
|
int i1 = 1, i2 = 2;
|
||||||
|
|
||||||
// Arithmetic is straightforward
|
// Arithmetic is straightforward
|
||||||
System.out.println("1+2 = " + (i1 + i2)); // => 3
|
System.out.println("1+2 = " + (i1 + i2)); // => 3
|
||||||
|
Reference in New Issue
Block a user