/images/art2.png

Review java - Variable

Basic types

Every type have a default value:

TypeRepresentationInitial valueStorageMax. value
bytesinged integer08 bits127
shortsinged integer016 bits32767
intsinged integer032 bits2147483647
longsinged integer064 bitsover 10^18
floatfloating point0.032 bitsover 10^38
doublefloating point0.064 bitsover 10^308
booleantrue or falsefalse1 bit
charUNICODE (not ASCII)u000016 bitsuFFFF

Difference between i++ and ++i

b = 1;
a = b++; // a = 1; b = 2
b = 1;
a = ++b; // a = 2; b = 2
int a = 1;
int res = a++ + a;
// res = 3 ; a = 2.
int a = 1;
int res = a + a++;
// res = 2; a = 2.
int a = 1;
int res = ++a + a;
// res = 4; a = 2.
int a = 1;
int res = a + ++a;
// res = 3; a = 2.

For loop

for(int i=0; i < n ; i++)

MarkDown overview

This is learning note for MarkDown

Heading 1

or

Heading 1

Heading 2

or

Heading 2

Italic and bold

italic or italic bold or bold italic and bold or italic and bold

Unordered list

  • line 1
  • line 2
  • line 3
    • sub 1
    • sub 2

or

  • line 1
  • line 2
  • line 3
    • sub 1
    • sub 2

Ordered list

  1. line 1
  2. line 2
    1. sub 1
    2. sub 2
  3. line 3

BlockQuotes

Use ‘>’ for a quotes

Welcome to Jekyll!

You’ll find this post in your _posts directory. Go ahead and edit it and re-build the site to see your changes. You can rebuild the site in many different ways, but the most common way is to run jekyll serve, which launches a web server and auto-regenerates your site when a file is updated.

To add new posts, simply add a file in the _posts directory that follows the convention YYYY-MM-DD-name-of-post.ext and includes the necessary front matter. Take a look at the source for this post to get an idea about how it works.