| |

VerySource

 Forgot password?
 Register
Search
View: 790|Reply: 3

How WebService returns a String [] of zero length

[Copy link]

1

Threads

2

Posts

3.00

Credits

Newbie

Rank: 1

Credits
3.00

 Invalid IP Address

Post time: 2020-2-14 06:00:01
| Show all posts |Read mode
Hello prawns, I have a String [] of zero length from the server. Why is the Null value at the client? How can I tell if the server passed Null or zero-length String []?
Reply

Use magic Report

0

Threads

3

Posts

4.00

Credits

Newbie

Rank: 1

Credits
4.00

 China

Post time: 2020-5-23 15:00:01
| Show all posts
How do you declare a variable
String [] a;
with
String [] a = new String [0];

are different
Reply

Use magic Report

1

Threads

2

Posts

3.00

Credits

Newbie

Rank: 1

Credits
3.00

 Invalid IP Address

 Author| Post time: 2020-8-11 22:45:01
| Show all posts
I tried, and return new String[0] is also a null value after it reaches the client
Reply

Use magic Report

0

Threads

1

Posts

2.00

Credits

Newbie

Rank: 1

Credits
2.00

 China

Post time: 2020-8-12 08:30:01
| Show all posts
This is because the server is lazy and does not pass a String with a length of 0. The client cannot get it and treat him as NULL.
Reply

Use magic Report

You have to log in before you can reply Login | Register

Points Rules

Contact us|Archive|Mobile|CopyRight © 2008-2023|verysource.com ( 京ICP备17048824号-1 )

Quick Reply To Top Return to the list