subject

An array of Strings, names, has been declared and initialized. Write the statements needed to determine whether any of the array elements are null or refer to the empty String. Set the variable hasEmpty to true if any elements are null or empty-- otherwise set it to false.
This is the code I put in, but it has compile errors
hasEmpty = false;
int k = 0;
for (k = 0; k < names. length; k++)
{
if ((names[k] == null) || (names[k].equals("")))
hasEmpty = true;
}

ansver
Answers: 1

Other questions on the subject: Computers and Technology

image
Computers and Technology, 22.06.2019 18:30, Liantic8738
List the five on-board vehicle subsystems
Answers: 1
image
Computers and Technology, 22.06.2019 22:40, ihatemylife0
Least square fit to polynomial write a function leastsquarefit3pol that solves a linear system of equations to find a least squares fit of a third order polynomial to an experimental data set given as two row arrays. the function leastsquarefit3pol must explicitly solve a set of linear equations and cannot use polyfit. there should be no restriction on the size of the problem that can be solved.
Answers: 1
image
Computers and Technology, 23.06.2019 00:00, brooklyn4932
What engine component is shown in the above figure?
Answers: 1
image
Computers and Technology, 23.06.2019 02:00, HannahVance99
In the context of an internet connection, llc stands for leased line connection liability limited company local loop complex local loop carrier
Answers: 1
You know the right answer?
An array of Strings, names, has been declared and initialized. Write the statements needed to determ...

Questions in other subjects:

Konu
Physics, 08.12.2019 12:31