I have a string array selectCancel
with setter and getter methods, which is a checkbox in my form. I am trying to get the checked values and I am getting the above result when I print.
I tried the Arrays.toString()
method but it still prints the same.
I then did the following:
String checked = Arrays.toString(Employee.getSelectCancel());
I also tried with the Arrays.asList()
and Arrays.copyOf()
So, how do I read this string?
lang. Object; is the name for Object[]. class , the java. lang. Class representing the class of array of Object .
This method returns true if, and only if, length() is 0. This method returns the index within this string of the last occurrence of the specified character. This method returns the index within this string of the last occurrence of the specified character, searching backward starting at the specified index.
The method works if you provide an array. The output of
String[] helloWorld = {"Hello", "World"}; System.out.println(helloWorld); System.out.println(Arrays.toString(helloWorld));
is
[Ljava.lang.String;@45a877 [Hello, World]
(the number after @
is almost always different)
Please tell us the return type of Employee.getSelectCancel()
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With