/images/art2.png

Review java - Array

Declaring an array Both are allow 1 2 string argc[]; string[] argc; Int array 1 2 int[] nums = new int[7]; nums[0] = 10; 1 2 Rabbit[] racers = new Rabbit[10];//10 empty rabbit array; racers[0] = new Rabbit("B","F"); arraycopy() 1 System.arraycopy(nums, 0, nums, 0, nums.length); Array vs ArrayList An array needs to know its size at the time of creation, arrayList does not. To assign an object in array you must assign it to a specific index.

Review java - javadoc

JavaDocs JavaDocs is able to easily generate a code “maintenance manual” A doc comment is made up of two parts – a description and two or more tag. 1 2 3 4 5 /** * Here is description * * @tag Comment for tag */ Tags @author (classes and interfaces only, required) @version (classes and interfaces only, required) @param (methods and constructors only) @return (methods only) @exception @see @since @serial (or @serialField or @serialData) @deprecated JDK Docs External documentation can be created with javadoc

Review java - OO

Class & Object A class only exists at compile time; An object only exists at runtime. Data Encapsulation Data Encapsulation/information hiding: where the internal state and operation are hidden from others. The more information Class A knows about Class B, the greater the possibility that changing Class A will adversely affect Class B. In an ideal world, making internal changes to Class A should have no, or very little, effect on other classes.

Review java - Variable

Basic types Every type have a default value: Type Representation Initial value Storage Max. value byte singed integer 0 8 bits 127 short singed integer 0 16 bits 32767 int singed integer 0 32 bits 2147483647 long singed integer 0 64 bits over 10^18 float floating point 0.0 32 bits over 10^38 double floating point 0.0 64 bits over 10^308 boolean true or false false 1 bit char UNICODE (not ASCII) u0000 16 bits uFFFF Difference between i++ and ++i 1 2 b = 1; a = b++; // a = 1; b = 2 1 2 b = 1; a = ++b; // a = 2; b = 2 1 2 3 int a = 1; int res = a++ + a; // res = 3 ; a = 2.

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 line 1 line 2 sub 1 sub 2 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.