About 1,380,000 results
Open links in new tab
  1. java - String.equals versus == - Stack Overflow

    String class overrides it to check if two strings are equal i.e. in content and not reference. == operator checks if the references of both the objects are the same.

  2. java - Difference between String trim () and strip () methods

    Among other changes, JDK 11 introduces 6 new methods for java.lang.String class: repeat(int) - Repeats the String as many times as provided by the int parameter lines() - Uses a Spliterator …

  3. java - Convert String into a Class Object - Stack Overflow

    I am storing a class object into a string using toString() method. Now, I want to convert the string into that class object. How to do that? Please help me with source code.

  4. java - String, StringBuffer, and StringBuilder - Stack Overflow

    The Java language provides special support for the string concatenation operator (+), and for conversion of other objects to strings. String concatenation is implemented through the …

  5. Using the equals() method with String and Object in Java

    Sep 8, 2014 · The equals() Method of the Object class doesn't know how to compare Strings, it only knows how to compare objects. For comparing strings, a string class will override the …

  6. Why is String immutable in Java? - Stack Overflow

    Mar 14, 2014 · String is Immutable in Java because String objects are cached in String pool. Since cached String literals are shared between multiple clients there is always a risk, where …

  7. How do I compare strings in Java? - Stack Overflow

    Apr 2, 2013 · The Java String class actually overrides the default equals() implementation in the Object class – and it overrides the method so that it checks only the values of the strings, not …

  8. java - Why can we use String without an import - Stack Overflow

    Oct 31, 2011 · When we use ArrayList or HashMap in Java, we have to import java.util.ArrayList or java.util.HashMap. But when we use String, it doesn't require the import statement. Can …

  9. string - How do I print my Java object without getting "SomeType ...

    Mar 19, 2015 · I have a class defined as follows: public class Person { private String name; // constructor and getter/setter omitted } I tried to print an instance of my class: …

  10. How to convert the following json string to java object?

    Apr 25, 2012 · It can also be used to convert a JSON string to an equivalent Java object. Gson can work with arbitrary Java objects including pre-existing objects that you do not have source …