summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorDhwani Shah <dshah202@gmail.com>2015-10-02 14:54:09 -0500
committerDhwani Shah <dshah202@gmail.com>2015-10-02 14:54:09 -0500
commit63793af2e955f8a8abe698c4a70809cfbff63452 (patch)
treeaf03b4c7feedd98b806456263835452bf86ac49f
parentc7240369b6465f2a736cb61d1bff89c971e76929 (diff)
Added section on how to declare and initialize both single varible and multiple varibles with the same value. Important concept for large structured programs. Seperated this a little bit.
-rw-r--r--java.html.markdown24
-rw-r--r--php.html.markdown4
2 files changed, 23 insertions, 5 deletions
diff --git a/java.html.markdown b/java.html.markdown
index 928eb39f..1aa06570 100644
--- a/java.html.markdown
+++ b/java.html.markdown
@@ -47,10 +47,30 @@ public class LearnJava {
///////////////////////////////////////
- // Types & Variables
+ // Variables
///////////////////////////////////////
-
+
+ /*
+ * Variable Declaration
+ */
// Declare a variable using <type> <name>
+ int fooInt;
+ // Declare multiple variables of the same type <type> <name1>, <name2>, <name3>
+ int fooInt1, fooInt2, fooInt3;
+
+ /*
+ * Variable Initialization
+ */
+
+ // Initialize a variable using <type> <name> = <val>
+ int fooInt = 1;
+ // Initialize multiple variables of same type with same value <type> <name1>, <name2>, <name3> = <val>
+ int fooInt1, fooInt2, fooInt3;
+ fooInt1 = fooInt2 = fooInt3 = 1;
+
+ /*
+ * Variable types
+ */
// Byte - 8-bit signed two's complement integer
// (-128 <= byte <= 127)
byte fooByte = 100;
diff --git a/php.html.markdown b/php.html.markdown
index 86fb14e5..1c2204fd 100644
--- a/php.html.markdown
+++ b/php.html.markdown
@@ -101,9 +101,7 @@ $sgl_quotes
END;
// String concatenation is done with .
-echo 'This string ' . 'is concatenated';
-// Strings concatenation can also be combined with html elements
-echo 'This string is' . '<strong>' . 'bold with strong tags ' . '</strong>.'
+echo 'This string ' . 'is concatenated';
/********************************