Basics
Basic File Structure:
1
2
3
4
5public class <SameAsFileName> {
public static void main(String args[]){
}
}Typecasting:
int a = (int) pow(2,5);
Binary: reference to formatting,
1
2
3
4
5
6
7int i = 0b10101010; // give binary value
System.out.println(Integer.toBinaryString(x)); // print binary
Integer.parseUnsignedInt("10101010", 2); //input binary
// print with padding
String.format(formatPattern, Integer.toBinaryString(data)).replace(' ', '0');
String formatPattern = "%" + maximumExpectedSize + "s";good
String
- Create a string of all character c:
String 10Spaces = new String(new char[10]).replace('\0', ' ');