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
FrozenT [24]
3 years ago
15

Given a one dimensional array arr, what is the correct way ofgetting the number of elements in arr

Computers and Technology
1 answer:
SVETLANKA909090 [29]3 years ago
3 0

Answer:

The answer is option 1 arr.length.

Explanation:

In java arr.length gives the correct number of elements in the array.The length is function is only applicable for arrays.

The length() method is applicable for strings.

arr.length-1 will give 1 element less.

There is no .size for arrays in java.

So we conclude that arr.length is correct way of getting the number of elements in one dimensional array arr.

You might be interested in
Which of the following statements about federal student loans is true?
never [62]
The correct answer is a.<span>) the interest rate on your loan will be fixed over time. 
</span>
7 0
3 years ago
Write a program code to accept the names of 3 users and generate a user name as shown in the example. Accept the name of 3 user
Nikitich [7]

Answer:

Explanation:

The following code is written in Python and is a function that loops three times asking for the last name and first name. Then it uses this information to create a username. Finally, each of the names and usernames is printed on the screen.

def userName():

   for x in range(3):

       last_name = input("What is your last name: ")

       first_name = input("What is your first name: ")

       username = first_name[:3] + "#" + last_name[-3:]

       print(last_name + ", " + first_name)

       print(username)

7 0
3 years ago
Write an<br> algorithm for "How to Polish Your<br> Shoes".
sammy [17]

Answer:

Step 1- Start

Step 2- Take out your shoes

Step 3- Take out the shoe polish

Step 4- Put the shoe polish on your shoe

Step 5- Then polish your shoe

Step 6- Stop

hope this helps

6 0
3 years ago
What are three characteristics of a vlan access port?
Effectus [21]
1.) switch port can become an access fourth or static or dynamic configuration.
2.) and access port is associated with a single VLAN.
3.) in access port is created with the switch port mode access command and then associated with a VLAN with the switchport access VLAN command.
7 0
3 years ago
A narrative is a:
drek231 [11]
It is B.series of links to other stories.
7 0
3 years ago
Read 2 more answers
Other questions:
  • The IT person most involved with system development is the _________
    14·1 answer
  • Given half a chance other people at work will take advantage of you
    11·1 answer
  • Which of the following is a way the operating system prevents unknown or unauthorized users from accessing the system?
    15·2 answers
  • Write an expression that executes the loop while the user enters a number greater than or equal to 0.
    10·1 answer
  • Network Architecture and Topology: Mastery Test
    15·1 answer
  • Which option in the file menu will open a blank document?
    14·1 answer
  • Please help!<br><br> What is a non-iterative programming structure?
    11·1 answer
  • . The electric company charges according to the following rate schedule: 9 cents per kilowatt-hour (kwh) for the first 300 kwh 8
    12·1 answer
  • #done with school already
    14·1 answer
  • ANs and WANs can be set up in several different shapes, also known as peripherals.
    6·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!