Access Modifier
| Class | Package | Subclass | Subclass | World
| | |(same pkg)|(diff pkg)|
————————————+———————+—————————+——————————+——————————+————————
public | + | + | + | + | +
————————————+———————+—————————+——————————+——————————+————————
protected | + | + | + | + | o
————————————+———————+—————————+——————————+——————————+————————
no modifier | + | + | + | o | o
————————————+———————+—————————+——————————+——————————+————————
private | + | o | o | o | o
+ : accessible
o : not accessible
Constructor:
Public class TrieTree
{
char ch;
//constructor, noted that no return type here. No need for constructor.
public TrieTree()
{
}
public TrieTree(char c)
{
ch = c;
}
}
Initialize Array
int[] data;
data = new int[] {10,20,30,40,50,60,71,80,90,91};
//OR
int[] data = new int[20];
List to Array
Inner Class Types