- Using Underscore Characters in Numeric Literals
- char —-> ‘\u0000’
- Copying Arrays
public static void arraycopy(Object src, int srcPos,
Object dest, int destPos, int length)
class ArrayCopyDemo {
public static void main(String[] args) {
char[] copyFrom = { 'd', 'e', 'c', 'a', 'f', 'f', 'e',
'i', 'n', 'a', 't', 'e', 'd' };
char[] copyTo = new char[7];
System.arraycopy(copyFrom, 2, copyTo, 0, 7);
System.out.println(new String(copyTo));
}
}
4. Array Manipulations
copyOfRange
class ArrayCopyOfDemo {
public static void main(String[] args) {
char[] copyFrom = {'d', 'e', 'c', 'a', 'f', 'f', 'e',
'i', 'n', 'a', 't', 'e', 'd'};
char[] copyTo = java.util.Arrays.copyOfRange(copyFrom, 2, 9);
System.out.println(new String(copyTo));
}
}
“`
5. Operators
All binary operators except for the assignment operators are evaluated from left to right; assignment operators are evaluated right to left.
for instance, 3 << 2 left shift
11 —> 1100.
3 —> 12 : 3 << 2 equal 3 * (2^2)