This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class HexUtils { | |
private static final char[] HEX_CHARS = "0123456789ABCDEF".toCharArray(); | |
private static final String HEX = "0123456789ABCDEF"; | |
/** | |
* Convert byte array to hexadecimal string | |
* @param data Input array | |
* @return hexadecimal string | |
*/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
final int x; | |
final int y = 1; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
int w; | |
int z = 2; | |
z = 3; | |
w = 1; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
final String name = null | |
String lastName | |
lastName = null |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Java | |
if(text != null){ | |
int length = text.length(); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Java | |
String name = "John"; | |
String lastName = "Smith"; | |
String text = "My name is: " + name + " " + lastName; | |
String otherText = "My name is: " + name.substring(2); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Java | |
String text = "First Line\n" + | |
"Second Line\n" + | |
"Third Line"; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Java | |
String text = x > 5 ? "x > 5" : "x <= 5" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Java | |
final int andResult = a & b; | |
final int orResult = a | b; | |
final int xorResult = a ^ b; | |
final int rightShift = a >> 2; | |
final int leftShift = a << 2; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Java | |
if(a instanceof String){ | |
final String result = ((String) a).substring(1); | |
} |
OlderNewer