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
liraira [26]
3 years ago
12

Which of the following method signatures correctly specifies an array as a return type?

Computers and Technology
1 answer:
kow [346]3 years ago
4 0

Answer:

private int[ ] testMethod ( int x )

Explanation:

Before going to the reason first understand the syntax of declare the function.

Syntax:

Access_modifier return_type name (argument_1, argument_2,...);

Access_modifier is used for making the restriction to access the values.

it is public, private and protected.

Return_type:  it is used to define return type of the function.

it can be int, float, double.

In the question:

Option 1:  private array testMethod ( int x )

it is not valid because array is not valid return type.

Option 2: private int[ ] testMethod ( int x )

int[ ]  denotes the integer array. so, the function return the integer array.

Option 3: private double[5] testMethod ( int x )

it is not valid because double[5] is not valid return type. we cannot enter the size of the array.

if we replace double[5] to double[ ], then it valid and the function return double type array.

Option 4: private double testMethod[ ] ( int x )

it return type is double. So, it return the decimal value but not array.

Therefore, the correct option is (b).

You might be interested in
What would happen if the coils in a generator stopped spinning?
just olya [345]
The generator will start to slow down and heat up.. because sooner or later the energy that is supposed to be going to the coils spinning then it all goes to heat.. The generator will either catch on fire or stop working completely. 
8 0
4 years ago
Read 2 more answers
1.<br> Why do you need to use sources of information when writing a formal business<br> document?
Lera25 [3.4K]

Answer:

You need sources of information when writing a formal business document because, if the person receiving the document would like to see the full source you got your information from it could help them understand better what they are reading. Also it looks more professional.

Explanation:

4 0
3 years ago
The PictureBook class is a subclass of the Book class that has one additional attribute: a String variable named illustrator tha
bulgar [2K]

Answer:s

s

Explanation:

x

8 0
4 years ago
What is the function of tab?<br>​
Sholpan [36]

Answer:

The function of the tab is used to advance the cursor to the next tab key.

5 0
1 year ago
Proprietary file types are easily displayed in Word documents, Web pages, etc.
lawyer [7]
It should be true :)
7 0
4 years ago
Other questions:
  • "a router interface has been assigned an ip address of 172.16.192.166 with a mask of 255.255.255.252. to which subnet does the i
    5·1 answer
  • A _____ is a predefined text format that includes multiple formatting options.
    14·1 answer
  • Write a command that will start and run the gedit command in the background.
    8·1 answer
  • PLEASE FILL IN THE BLANK FOR THESE POINTS!!!!!
    15·2 answers
  • When a subdomain has been delegated to a zone on another server, the DNS server hosting the parent zone maintains only an NS rec
    14·1 answer
  • Which business application uses electronic tags and labels to identify objects wirelessly over short distances?
    8·1 answer
  • All languages require the code which is simply a word that means _____.
    9·1 answer
  • 1. (01.03 MC) What is a string in Python
    9·2 answers
  • An international pharmaceutical company is fully compliant with local and international regulations. However, they suffered a ma
    14·1 answer
  • A vpn is used primarily for which purpose?
    10·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!