About 50 results
Open links in new tab
  1. java - Why is String a class? - Stack Overflow

    Oct 3, 2012 · String interning is handled by the language and JVM (interning). Integer i = 5 is simply autoboxing (language). In addition Integer.valueOf does some pollng, but this is handled by the …

  2. 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 their locations …

  3. java - String is immutable. What exactly is the meaning ... - Stack ...

    Jan 10, 2012 · In the String constant pool, a String object is likely to have one or many references. If several references point to same String without even knowing it, it would be bad if one of the …

  4. How to convert String type to Class type in java - Stack Overflow

    How to convert String type to Class type in java Asked 13 years, 5 months ago Modified 2 years, 6 months ago Viewed 63k times

  5. java - What is the "String [] args" parameter in the main method ...

    May 21, 2009 · That String[] args part may become optional in future versions of Java. Work is underway to allow for simplified declaration of main method. See JEP 463: Implicitly Declared …

  6. java - How to mock a String using mockito? - Stack Overflow

    The problem is the String class in Java is marked as final, so you cannot mock is using traditional mocking frameworks. According to the Mockito FAQ, this is a limitation of that framework as well.

  7. 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.

  8. What is the difference between String and StringBuffer in Java?

    Mar 13, 2010 · Java provides the StringBuffer and String classes, and the String class is used to manipulate character strings that cannot be changed. Simply stated, objects of type String are read …

  9. 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 one client's …

  10. 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 equals() …