+ 7

Learn Java! 🚶 by 🚶!!

¤ Atom (one of the best editor) https://atom.io/ ¤ Terminal (to compile and execute our program) Steps 1)ctrl+t 2)mkdir Java_Examples 3)cd Java_Examples 4)ls (HelloWorld.java) 5)javac HelloWorld.java 6)ls (HelloWorld.java ) (HelloWorld.class) 7)java HelloWord (Hello World! 🌎) IDE ¤ Bluej (learn and understand basics) https://bluej.org/ ¤ Netbeans (make big programs advanced) https://netbeans.org/ Let's start! http://www.tutorialspoint.com/java

16th Sep 2017, 12:41 AM
Ardu
Ardu - avatar
3 Réponses
+ 2
http://www.cs.utexas.edu/%7Escottm/cs307/handouts/BlueJProjectInstructions.html
16th Sep 2017, 10:22 AM
Ardu
Ardu - avatar
16th Sep 2017, 12:54 AM
👑 Prometheus 🇸🇬
👑 Prometheus 🇸🇬 - avatar
+ 1
As just explained, the equals( ) method compares the characters inside a String object. The == operator compares two object references to see whether they refer to the same instance. The following program shows how two different String objects can contain the same characters, but references to these objects will not compare as equal: // equals() vs == class EqualsNotEqualTo { public static void main(String args[]) { String s1 = "Hello"; String s2 = new String(s1); System.out.println(s1 + " equals " + s2 + " -> " + s1.equals(s2)); System.out.println(s1 + " == " + s2 + " -> " + (s1 == s2)); } } The variable s1 refers to the String instance created by "Hello". The object referred to by s2 is created with s1 as an initializer. Thus, the contents of the two String objects are identical, but they are distinct objects. This means that s1 and s2 do not refer to the same objects and are, therefore, not ==, as is shown here by the output of the preceding example: Hello equals Hello -> true Hello == Hello -> false https://code.sololearn.com/caU8aekQCmn3/?ref=app
16th Sep 2017, 10:06 AM
Ardu
Ardu - avatar