https://nbcamp.gitbook.io/java-handbook/part-02.
Source: https://www.java67.com/2014/08/difference-between-string-literal-and-new-String-object-Java.html#ixzz81C2VSaTS
Source2: https://www.javatpoint.com/java-string-intern
String strObject = new String("Java");
and
String strLiteral = "Java";
Both expressions give you a String object, but there is a subtle difference between them. When you create a String object using the new() operator, it always creates a new object in heap memory.
On the other hand, if you create an object using String literal syntax e.g. "Java", it may return an existing object from String pool (a cache of String object in Perm gen space, which is now moved to heap space in recent Java release), if it already exists.
Since String is one of the most used types in any application, the Java designer took a step further to optimize the uses of this class. They know that Strings will not be going to be cheap, and that's why they come up with an idea to cache all String instances created inside double quotes e.g. "Java". These double quoted literal is known as String literal and the cache which stored these String instances are known as String pool.
At a high level both are String objects, but the main difference comes from the point that the new() operator always creates a new String object.
String a = "Java";
String b = "Java";
System.out.println(a == b); // True
String c = new String("Java");
String d = new String("Java");
System.out.println(c == d); // False
String e = "JDK";
String f = new String("JDK");
System.out.println(e == f); // False
== compares values of operands.
When operands are non-primitive(a.k.a reference) data, their values are memory addresses.
Java by default doesn't put all String objects into the String pool, instead, it gives you the flexibility to explicitly store any arbitrary object in the String pool. You can put any object to the String pool by calling the intern() method of java.lang.String class.
String str0 = new String("newIntern").intern();
String str1 = new String("newIntern").intern();
System.out.println(str0 == str1); // True
String str2 = "literalAutoIntern"; //A string literal always invokes the intern() method
String str3 = "literalAutoIntern";
System.out.println(str2 == str3); // True
String str4 = new String("newInternAndLiteral").intern();
String str5 = "newInternAndLiteral";
System.out.println(str4 == str5); // True
You should compare two String objects using the equals() method and avoid comparing them with the == operator, because you would not know which one is coming from pool and which one is created using new operator.
source: https://www.javatpoint.com/signed-and-unsigned-binary-numbers-in-digital-electronics
There is no sign bit in unsigned binary numbers so it can only represent its magnitude. There is only one zero (0) in this representation, which is always positive. Because of one unique binary equivalent form, it is known as unambiguous representation technique. The range of the unsigned binary numbers starts from 0 to -1.
The signed numbers are represented in three ways. The signed bit makes two possible representations of zero (positive (0) and negative (1)), which is an ambiguous representation. The third representation is 2's complement representation in which no double representation of zero is possible, which makes it unambiguous representation. There are the following types of representation of signed binary numbers: