1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
klasskru [66]
4 years ago
9

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;
}
Computers and Technology
1 answer:
Ghella [55]4 years ago
3 0

Answer:

boolean hasEmpty = false; //This is line which have compile time error and which is modified.

int k = 0; //Taken from the question.

for (k = 0; k < names.length; k++)// Taken from the question.

           {//Taken from the question

               if ((names[k] == null) || (names[k].equals("")))//Take from the question.

                hasEmpty = true; //taken from the question.

              }//Taken from the question.

Explanation:

  • There is one line which gives the compile-time error and that is in the "hasEmpty = false;" statement because there is no any data type defined for this value, so when we write the code in the java language, then we need to define it like " boolean hasEmpty = false; ".
  • The above answer is in java language because there are "names.length" which is used in java and the string data type is also used in java which is defined in the question.
You might be interested in
Complex calculations show that if the universe is geometrically flat, we should observe the greatest temperature differences bet
Rufina [12.5K]

Answer:

Answer is 1 degree.

Explanation:

W MAP stands for Wilkinson Anisotropy Probe which was working from 2001 to 2010 .It usually measured the temperature differences.Big Bang was a partnership with NASA and Princeton University. So if universe is geometrically flat we should observed that temperate between patches are separated by 1 degree.Because Universe is oval shape and contain 360 angular shape but if it goes flat we can see the patches at very low distance that is 1 degree.

7 0
4 years ago
Which type of software should he use to restrict his information from going out to these websites?
Nataly [62]
Please provide question with more information

7 0
3 years ago
Read 2 more answers
What are possible challenges for cyber bullying
Anestetic [448]

Answer:

well, you will have your account deleted/ arrested because of cyber bullying

Explanation:

so don't!!! (hint hint XD)

6 0
3 years ago
Read 2 more answers
Co to jest podprogram (procedura lub funkcja)? Zaznacz poprawną odpowiedź. a) Wielokrotne powtarzanie tych samych poleceń. b) Wy
ale4655 [162]

Answer:

  b)  A separate part of the program that performs a specific task.

Explanation:

A subroutine is a portion of the program that can be invoked to perform a specific task. Typically, it performs that task and returns execution control to the point immediately following its invocation. It may or may not maintain "history" or "state", and it may or may not throw exceptions.

A well-behaved subroutine will only operate on data passed to it, will not maintain any internal history or state, and will have only one exit.

8 0
3 years ago
What is the term for the process of swapping items between memory and storage?
Naddik [55]
Swapping pages of memory from core memory and disk is called swapping in Unix, and paging in Microsoft.
3 0
3 years ago
Read 2 more answers
Other questions:
  • Our company is only interested in purchasing a software upgrade if it leads to faster connectivity and data sharing. The old sof
    7·1 answer
  • Under the class system, how many host ids were available in a class b network?
    7·1 answer
  • Programs that are based on ___ graphics record your images on a pixel by pixel basis and will typically save files in formats su
    15·1 answer
  • Which description best explains a placeholder?
    7·1 answer
  • The technology Herman Hollerith created in the 1880s began the modern-day data processing function in computers.
    9·1 answer
  • Let f and g be two one-argument functions. The composition f after g is defined to be the function x 7→ f (g (x)). Define a proc
    15·1 answer
  • You might have trouble interpreting a message if:
    15·1 answer
  • RIGHT ANSWER GETS BRAINLEST
    5·1 answer
  • 2.<br> Solve each equation.<br> a)<br> 3n - 8 = 2n + 2<br> b)<br> 4n + 75 = 5n + 50
    14·1 answer
  • Technology?
    9·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!