<commit_before>---
layout: post
title: Java Programming Notes (2) - Data Type & Expression & Array
---
Course: [Java Programming (Coursera)](https://class.coursera.org/pkujava-001)  
Instructor: [<NAME>](https://www.coursera.org/instructor/~3838), [Peking University](http://english.pku.edu.cn/)

### Data Type
* Primitive Type: stored in the stack (_"Here"_)
  * Numeric Type
    * Integer: **byte, short, int, long**
    * Float: **float, double**
  * **char**
  * **boolean**
* Reference Type: pointer to the object stored in the heap (_"There"_)
  * **class**
  * **interface**
  * **Array**

1. Primitive Type
  * boolean
  
  ```java
  if (a = 5) //Wrong!!! Nonzero doesn't mean false!
  ```
   * char: Unicode
  
  ```java
  char c1 = '\u0061' //c1 = 'a'
  ```
   * Integer
<table style="width:100%">
  <tr>
    <th>Firstname</th>
    <th>Lastname</th>		
    <th>Points</th>
  </tr>
  <tr>
    <td>Jill</td>
    <td>Smith</td>		
    <td>50</td>
  </tr>
  <tr>
    <td>Eve</td>
    <td>Jackson</td>		
    <td>94</td>
  </tr>
  <tr>
    <td>John</td>
    <td>Doe</td>		
    <td>80</td>
  </tr>
</table>
<commit_msg>Update 2015-5-1-Java-Notes-2.md<commit_after>---
layout: post
title: Java Programming Notes (2) - Data Type & Expression & Array
---
Course: [Java Programming (Coursera)](https://class.coursera.org/pkujava-001)  
Instructor: [<NAME>](https://www.coursera.org/instructor/~3838), [Peking University](http://english.pku.edu.cn/)

### Data Type
* Primitive Type: stored in the stack (_"Here"_)
  * Numeric Type
    * Integer: **byte, short, int, long**
    * Float: **float, double**
  * **char**
  * **boolean**
* Reference Type: pointer to the object stored in the heap (_"There"_)
  * **class**
  * **interface**
  * **Array**

1. Primitive Type
  1. boolean
  
    ```java
    if (a = 5) //Wrong!!! Nonzero doesn't mean false!
    ```
  2. char: Unicode
  
    ```java
    char c1 = '\u0061' //c1 = 'a'
    ```
  3.  Integer
{'fraction_non_alphanumeric': 0.2037037037037037, 'fraction_numerical': 0.026234567901234566, 'mean_word_length': 2.9292929292929295, 'pattern_counts': {'":': 0, '<': 39, '<?xml version=': 0, '>': 39, 'https://': 4, 'lorem ipsum': 0, 'www.': 2, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '221285', 'n_tokens_mistral': 790, 'n_tokens_neox': 737, 'n_words': 181}