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
The ____________________ packet-filtering firewall allows only a particular packet with a particular source, destination, and po
kolbaska11 [484]

Answer:

Dynamic packet-filtering firewall.            

Explanation:

Packet filtering is basically a technique of scanning and filtering the network data packets. This technique allows or disallows the network packets to enter through the firewall or to transmit from one network to the other. Dynamic packet filtering packet-filtering firewall allows only a particular packet with a particular source, destination, and port address to enter through the firewall. It utilizes the information in packet header and inspects and utilizes active connections state information. This information enables to decide which packet should enter through the firewall.

8 0
3 years ago
The following statements regarding centralized administration concepts are presented to you in an interview in which only one of
max2010maxim [7]

Answer: B

Explanation: The extensible authentication protocol (EAP) is a framework that is used to transport authentication protocols.

6 0
2 years ago
What function does an extranet perform?
dsp73

Answer:

An extranet is a private network that uses Internet technology and the public telecommunication system to securely share part of a business's information or operations with suppliers, vendors, partners, customers, or other businesses.

6 0
3 years ago
What are the two basic steps in communication
Andrei [34K]

The sender forms an idea.The sender encodes the idea in a message.

4 0
4 years ago
Which of the following is an example of a soft skill?
Lady bird [3.3K]
Answer is (B)

Helping a customer by answering a question whether on the phone of face to face is an example of soft skills. Such skills are developed through Effective communication, better listening skills, positivity, assertiveness, empathy, conflict resolution, and depersonalization. 
<span>Basically, if you have these skills when handling a customer, what they will remember is what they felt about your service.</span>

 
8 0
3 years ago
Read 2 more answers
Other questions:
  • You try to enter your name into a cell that accepts a numeric value. What error would you receive
    12·2 answers
  • What is cryptocurrency ? I need to do a research one it please help!
    6·1 answer
  • Microsoft windows server and linux are examples? of:
    12·1 answer
  • The first step in the five-step process for problem solving is to ____. evaluate take action understand the task or need complet
    10·2 answers
  • When you use the Bing Image Search for online pictures, you will be searching the Internet for pictures that have been filtered
    13·2 answers
  • Jenny has to include the image of a sun on one of her slides. She needs to write relevant text about it on a dark background on
    6·1 answer
  • What is an IP address and where I can find the IP address for my computer?
    14·1 answer
  • Before creating a brief to design a product, what is needed
    8·1 answer
  • marco wants to create a heading that is bold and italic to make it really stand out on his webpage. he's typed in the code
    12·2 answers
  • 11.5 Code Practice edhesive
    10·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!