About 2,200,000 results
Open links in new tab
  1. How to use the toString method in Java? - Stack Overflow

    Sep 1, 2010 · Can anybody explain to me the concept of the toString() method, defined in the Object class? How is it used, and what is its purpose?

  2. java - Qual é a função do método toString ()? - Stack Overflow em …

    Jun 14, 2017 · The toString method for class Object returns a string consisting of the name of the class of which the object is an instance, the at-sign character `@', and the unsigned …

  3. How to override toString() properly in Java? - Stack Overflow

    May 24, 2012 · Java toString () method If you want to represent any object as a string, toString () method comes into existence. The toString () method returns the string representation of the …

  4. How do I print my Java object without getting …

    Mar 19, 2015 · 520 Background All Java objects have a toString() method, which is invoked when you try to print the object. System.out.println(myObject); // invokes myObject.toString() This …

  5. java - Testing toString Junit - Stack Overflow

    String toString = name.toString(); // this test checks that the String at least is // outputting "first=" followed by the first variable // but the first variable may incorrect 1's and 0's

  6. Java - Convert integer to string - Stack Overflow

    Integer class has static method toString () - you can use it: int i = 1234; String str = Integer.toString(i); Returns a String object representing the specified integer. The argument is …

  7. java - How make toString () method return Super Class private …

    Nov 26, 2014 · Is there a way to make toString() include private fields of the super class? I tried adding a super.toString(), no use however. Please see the code below Employee.java …

  8. java - How is Set.toString () implemented? - Stack Overflow

    The code executed when HashSet.toString() is called is in AbstractCollection. You can see this in the API docs from HashSet where it says: "Methods inherited from class …

  9. java - Using Enum values as String literals - Stack Overflow

    Jul 12, 2011 · JavaDoc: String java.lang.Enum.name () Returns the name of this enum constant, exactly as declared in its enum declaration. Most programmers should use the toString …

  10. java - Printing out a linked list using toString - Stack Overflow

    Printing out a linked list using toString Asked 12 years ago Modified 2 years, 11 months ago Viewed 158k times