Ask your own question, for FREE!
Computer Science 18 Online
OpenStudy (anonymous):

Which of the following arguments must be passed when passing an array as an argument? The array itself - An integer that specifies the number of elements in the array - The data type of the array - The array itself and An integer that specifies the number of elements in the array - The array itself and The data type of the array

OpenStudy (anonymous):

I know the answer is not "An integer that specifies the number of elements in the array." Could is perhaps be "The array itself and An integer that specifies the number of elements in the array"?

OpenStudy (woodrow73):

Based on only 1 example (in java), I would guess just the array itself. Within java, the insert method of the StringBuilder class, can take a char array as an argument- and in passing it as an argument, you simply list the variable. For example: char charzard[] = { ',', ' ', 'D', 'r', '.' }; StringBuilder str = new StringBuilder("Hello Korebetha."); str.insert(5, charzard); //Here the char array is passed as an argument System.out.print(str); This will print: Hello, Dr. Korebetha. Though I'm just guessing

OpenStudy (woodrow73):

in the code, put // before argument - it's part of the comment above it.

OpenStudy (woodrow73):

@korebetha

OpenStudy (anonymous):

@woodrow73 Thank you for the response. I'll have to check, but originally I figured it was one or the other, and since it's not the integer, it must be the aray itself. The textbook says something like array[6] and that is why I believed it to be the integer. Thank you.

OpenStudy (anonymous):

@sparkel101

OpenStudy (anonymous):

I guess you deleted your rude remark. Guess what, it e-mails me what you said. I didn't do anything to you.

OpenStudy (woodrow73):

sparkel's comments were removed by a mod. Don't take anything that child says at face value. & glad it helped! @korebetha

Can't find your answer? Make a FREE account and ask your own questions, OR help others and earn volunteer hours!

Join our real-time social learning platform and learn together with your friends!
Can't find your answer? Make a FREE account and ask your own questions, OR help others and earn volunteer hours!

Join our real-time social learning platform and learn together with your friends!