+ 4
What is .toString(); method in JAVA...?
3 ответов
+ 1
It is a method that returns a string representing nicely the data within the objects.
So when you want to print an object, it will print that string rather than some random binary or error.
It is a good idea to ensure t the toString function is implemented when you define a new class.
+ 5
You can lookout it here https://stackoverflow.com/questions/3615721/how-to-use-the-tostring-method-in-java
+ 1
To perform an ordering with a comma, use the ToString () method of the Array object
// Join + "," with ToString obejto method Array
var arr_semana = new Array ();
arr_semana [0] = " Monday ";
arr_semana [1] = "Tuesday";
arr_semana [2] = " Wednesday ";
var sorts = arr_semana.toString ();
document.write (sort);
// output Monday, Tuesday, Wednesday