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
harkovskaia [24]
3 years ago
13

What does this method do?

Computers and Technology
1 answer:
DIA [1.3K]3 years ago
8 0

COMPLETE QUESTION:

What does this method do?

public static int foo(String [][] a)

{

int b = 0;

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

{

b++;

}

return b;

}

Answer:

Returns the value of b which is the dimension of the array

Explanation:

The method foo accepts a multi dimension array and returns the dimension of the array. A complete code implementation and call to the method is given below:

<em>public class TestClass {</em>

<em>    public static void main(String[] args) {</em>

<em>    String [ ] [ ] arr = {{"gh","hj","fg", "re","tr"},{"","er","df","fgt", "tr"}};</em>

<em>        System.out.println(foo(arr));</em>

<em>    }</em>

<em>    public static int foo(String [ ][ ] a)</em>

<em>    {</em>

<em>        int b = 0;</em>

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

<em>        {</em>

<em>            b++;</em>

<em>        }</em>

<em>        return b;</em>

<em>    }</em>

<em>}</em>

The output from the code snippet is the value of b which is 2

You might be interested in
If David wishes to digitally sign the message that he is sending Mike, what key would he use to create the digital signature
Goshia [24]

The key would he use to create the digital signature is Mike public key.

<h3>Which key is used to sign messages?</h3>

Digital signatures are known to be used via public key. Here, the person is said to be one who is said to produce or creates the digital signature that  uses a private key to encrypt signature-linked data.

The only way to decrypt a data is only with the signer's public key, the key David would use to create the digital signature is Mike public key.

Learn more about  public key from

brainly.com/question/17486027

7 0
2 years ago
Can someone answer these 2 please
Leto [7]

Answer:

c for the first one and d for the secound one

Explanation:

5 0
3 years ago
What are the coordinates of the origin point? (Select the best answer.)
siniylev [52]

Answer:

1,10

Explanation:

7 0
4 years ago
A(n) ______ is system software.
arsen [322]
System software<span> is a type of computer program that is designed to run a computer's hardware and application programs. If we think of the computer </span>system <span>as a layered model, the </span>system software<span> is the interface between the hardware and user applications</span>
7 0
4 years ago
Many documents use a specific format for a person's name. Write a program whose input is: firstName middleName lastName, and who
never [62]

Answer:

Python Program:

if __name__ == '__main__':

   a = input("Enter Name: ")

   b = a.split()

   print(b[2] + ',' , b[0], b[1][0])

Explanation:

The input function will be used to prompt user to enter the name of the person. The person's name will be stored in variable a.

Let us assume that the user entered a name mentioned in the example, which is Pat Silly Doe, Now variable a = 'Pat Silly Doe'.

The function a.split() is used to split a string into a list. The splitting (by default) is done on the basis of white-space character. Therefore, a.split() will give a list

['Pat', 'Silly', 'Doe']

which will be later on stored in variable b.

We can use the subscript operator [] to access the values in a list. Suppose if we have a list a, then a[i] will give us ith element of a, if i < length of a.

Finally, we print the answer. b[2] will give us the last name of the person. We append a comma using '+' operator. b[0] will give us the first name. b[1] will give us the middle name, but since we only need one character from the middle name, we can use another subscript operator b[1][0] to give us the first character  of the middle name.

Note: Characters of strings can be accessed using subscript operator too.

4 0
4 years ago
Other questions:
  • which tag does not display the text in the browser window and makes the sources code mode readable ?​
    6·1 answer
  • Which of the following is a valid call for the generic method declared below? and why?
    9·2 answers
  • List 5 different programming languages calls to print
    8·2 answers
  • Java: Literal representing the true value ? In java, what is the literal that represents a true value ?
    6·1 answer
  • Which group of commands all appear on the Standard toolbar?
    7·1 answer
  • Billy used to take care of his laptop. However, one day he lost his laptop. He lost all his data, and there was no way to retrie
    11·1 answer
  • You are reviewing the output of the show interfaces command for the Gi0/1 interface on a switch. You notice a significant number
    12·1 answer
  • (PLEASE HELP)
    5·1 answer
  • HELP!!!!!!!
    8·1 answer
  • Whats the best way to make a video game?
    14·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!