diff options
author | Levi Bostian <levi.bostian@gmail.com> | 2015-10-04 17:13:51 -0500 |
---|---|---|
committer | Levi Bostian <levi.bostian@gmail.com> | 2015-10-04 17:13:51 -0500 |
commit | 84a2cd07487ccb92bf47d725a4257824f9df1ddb (patch) | |
tree | 4e95d206121364128bf3fe6616e17550ad80628a | |
parent | 15e5d0176328e42c4feeba38e7f6329251c510ae (diff) | |
parent | 4e139ae2f528a08eb47427ea790bd176092e1bf0 (diff) |
Merge pull request #1300 from dhwanishah/javaPageChange
Added how to declare and initialize variables for single and multiple instances
-rw-r--r-- | java.html.markdown | 24 | ||||
-rw-r--r-- | php.html.markdown | 2 |
2 files changed, 23 insertions, 3 deletions
diff --git a/java.html.markdown b/java.html.markdown index 89a710ee..e4234a39 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 bc345af0..93066284 100644 --- a/php.html.markdown +++ b/php.html.markdown @@ -709,4 +709,4 @@ If you're coming from a language with good package management, check out [Composer](http://getcomposer.org/). For common standards, visit the PHP Framework Interoperability Group's -[PSR standards](https://github.com/php-fig/fig-standards). +[PSR standards](https://github.com/php-fig/fig-standards).
\ No newline at end of file |