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
Categorize the following relationships into generalization, aggregation, or association. Beware, there may be n-ary associations
Oksana_A [137]

Answer:

Answer explained below

Explanation:

a. A country has a capital city.------------ aggregation(city is part of country)

b. A dining philosopher uses a fork. ----------- association(philosopher and fork are different entities)

c. A file is an ordinary file or a directory file. ------- generalization( both ordinary and directory files are having attributes of files)

d. Files contain records.--------- aggregation( records are part of File)

e. A polygon is composed of an ordered set of points. ----------- aggregation( points are parts of polygon)

f. A drawing object is text, a geometrical object, or a group. --------- generalization( text and geometrical objects are drawing object)

g. A person uses a computer language on a project. -------- aggregation( person and computer language are part of project)

h. Modems and keyboards are input/output devices. -------- aggregation( Modems and keyboards both are I/O devices)

i. Classes may have several attributes.------- aggregation( attributes are part of classes)

j. A person plays for a team in a certain year. ----------- aggregation(player is part of team)

k. A route connects two cities. --------- aggregation( route consists of two cities)

l. A student takes a course from a professor. ----------- association( student and course are separate entities)

5 0
3 years ago
Question # 1 Multiple Select Which of the following shows the assignment of a string to a variable? Select 3 options. answer = "
bazaltina [42]

Answer:

answer = input("How old are you?")

Explanation:

Answer is a variable The Input function takes a string

6 0
2 years ago
Read 2 more answers
GMI = $4,666.67 Total Monthly Deductions $1,131.00 What is the Net Monthly Income (GMI - Total Monthly Deductions) =
Kisachek [45]

Answer:

Net Monthly Income = $3,535.67

Explanation:

Given:

GMI = $4,666.67

Total Monthly Deductions = $1,131

Find:

Net Monthly Income

Computation:

Net Monthly Income = GMI - Total Monthly Deductions

Net Monthly Income = $4,666.67 - $1,131

Net Monthly Income = $3,535.67

6 0
3 years ago
5. In what ways is the human brain like a computer? In what ways is it different?
yan [13]

Answer:

Similar to a computer, the human brain is like a storage unit of information and operator for the human body. Though the brain can hold more info than a computer, both are used to complete various tasks.

Explanation:

5 0
2 years ago
Read 2 more answers
Which tables and fields would you access to determine which book titles have been purchased by a customer and when the order shi
enyata [817]

Answer:

To determine which book titles have been purchased by a customer and when the order shipped the following tables and fields would be used.

Table:      

  • CUSTOMERS

Fields

  • Customerno

Table

  • ORDERS

Fields:

  • Orderno
  • Shipdate
  • Customerno

Table:

  • ORDERITEMS

Fields:

  • Orderno

Table:

  • BOOKS

Fields

  • isbn
  • title

BOOKS table contains field like title of the books, so this will help in finding which book titles have been purchased.

CUSTOMERS table keeps information about customers that purchasing an ordering the books. The customerno uniquely identifies each customer so that the order information can be found using the customerno of a specific customer.

ORDERITEMS keeps information about orders via orderno

ORDERS table will keep track about the shipment of orders. Orderno identifies each order, shipdate will help determine when an order is shipped.

7 0
3 years ago
Other questions:
  • What does iSCSI stand for?
    5·2 answers
  • What is an advantage of sharing documents in PDF format instead of Word format?
    6·2 answers
  • What control features will you use in the input screens to aid in data entry? give a specific example of how you will use at lea
    6·1 answer
  • If you are viewing a webpage with customized or regenerated content, such as updated stock quotes, what type of webpage are you
    14·1 answer
  • What happens of the gamers dont follow the age ratings
    14·2 answers
  • Urgent ..algorithm and flowchart to check weather a number is odd or even ???​
    8·2 answers
  • Keli is unable to find a shape that meets her needs. Which feature in Power Point should she use to create shapes that are compl
    6·1 answer
  • The Arizona Department of Transportation has offices throughout the state. State documents are stored on a large server in a cen
    5·2 answers
  • In this exercise, you are asking the user to set a alpha numeric password for any website. Put some conditions.
    8·1 answer
  • Another way to create a new presentation is from the Home tab
    6·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!