Computer Science, asked by arsana2577, 7 months ago

What is the output of the following string s="Goa"; string S1=s.trim();
System.out.println+s1.length());

Answers

Answered by Haruhi22
0

Answer:

System.out.println+s1.length()); gives error brackets are not placed correctly

System.out.println(s1.length()); gives 3 as answer

Because trim eliminates spaces before G and after a.

As there are no spaces it would return the size of the string.

Similar questions