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
choli [55]
3 years ago
9

Write statementsto show how finding the length of a character array char [ ] differs from finding the length of a String object

str.
Computers and Technology
1 answer:
NARA [144]3 years ago
4 0

Answer:

Length of char array: sizeof(arr)

Length of a string object: myString.length()

Explanation:

The sizeof approach is generally not recommended, since this information is lost as soon as you pass the array to a function, because then it becomes a pointer to the first element.

You might be interested in
Write a statement that outputs variable numObjects. End with a newline.
dalvyx [7]

Answer:

The code is witten in Java and given in the explanation section.

Using a Scanner object we receive a the user's input and with the System.out.println we output the variable

Explanation:

import java.util.Scanner;

public class VariableOutput{

   public static void main (String [] args){

       Scanner input = new Scanner(System.in);

       System.out.println("Enter an Integer 15 or 40");

       int numObjects = input.nextInt();

       System.out.println("You entered the number "+numObjects);

   }

}

7 0
3 years ago
Write a public member function which replace that replaces one occurrence of a given item in the ArrayBag with another passed as
ira [324]

Answer:

The method is written in Java

public static boolean abc(int [] ArrayBag,int num, int replace){

    Boolean done = false;

    for(int i =0; i<ArrayBag.length;i++){

        if(ArrayBag[i] == num){

            ArrayBag[i] = replace;

            done = true;

        }

    }

    for(int i = 0;i<ArrayBag.length;i++){

        System.out.println(ArrayBag[i]+" ");

    }

    return done;

}

Explanation:

The method is written in java

The arguments of the method are:

<em>1. ArrayBag -> The array declares as integer</em>

<em>2. num -> The array element to check the presence</em>

<em>3. replace - > The replacement variable</em>

This line defines the method as boolean.

public static boolean abc(int [] ArrayBag,int num, int replace){

This line declares a boolean variable as false

    Boolean done = false;

The following iterates through the elements of the array

    for(int i =0; i<ArrayBag.length;i++){

This checks if the array element exist

        if(ArrayBag[i] == num){

If yes, the array element is replaced

            ArrayBag[i] = replace;

The boolean variable is updated from false to true

            done = true;

        }

    }

The following iteration prints the elements of the array

<em>     for(int i = 0;i<ArrayBag.length;i++){</em>

<em>         System.out.println(ArrayBag[i]+" ");</em>

<em>     }</em>

This prints returns the boolean thats indicates if replacement was done or not.

    return done;

}

<em>Attached to this solution is the program source file that includes the main method of the program</em>

Download txt
5 0
3 years ago
Engineers at Edison Laboratories developed a _____ strip that allowed them to capture sequences of images on film.
maxonik [38]

Answer:

Kinetoscope

Explanation:

4 0
2 years ago
Read 2 more answers
What is gland? mention it's type​
stealth61 [152]

Answer:

Gland is an organ that makes one or more substances, such as hormones, digestive juices, sweat, tears, saliva, or milk.

TYPES OF GLANDS :

ENDOCRINE glands release the substances directly into the bloodstream.

EXOCRINE glands release the substances into a duct or opening to the inside or outside of the body.

BRAINLIEST PLEASE

5 0
2 years ago
Read 2 more answers
In some networks, the data link layer handles transmission errors by requesting that damaged frames be retransmitted. If the pro
Usimov [2.4K]

Answer:

The answer with explanation is attached in the file.

Explanation:

Download docx
3 0
3 years ago
Other questions:
  • In an office there is a unisex bathroom with n toilets. The bathroom is open to both men and women, but it cannot be used by men
    14·1 answer
  • A (blank) is a way for students to keep track of information during research
    7·2 answers
  • To paste text with the same formatting as the document in which it is entered, select _____ from the Paste menu. Keep Source For
    12·2 answers
  • Using Word, Maureen is writing an outline of a presentation she plans to give to her company. She will be showing a video during
    12·2 answers
  • Can someone please help me with the three questions please?
    6·1 answer
  • As a photographer, what will be the driving force behind everything that you produce?
    13·1 answer
  • Select the correct answer.
    10·2 answers
  • The road is closed a head
    9·1 answer
  • Select all the correct answers
    11·1 answer
  • What type of software is an antivirus?
    5·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!