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
babunello [35]
3 years ago
5

Which of the following method calls are legal?a. mathMethod(x);b. mathMethod(y);c. mathMethod(x, y);d. mathMethod(x + y);e. math

Method(12L);f. mathMethod(12);g. mathMethod(12.2);h. mathMethod();i. mathMethod(a);j. mathMethod(a / x);
Computers and Technology
1 answer:
Roman55 [17]3 years ago
7 0

Answer:

Option a, b, d, f, and j is legal method calls.

Explanation:

In the given question some information is missing, that is the method definition which can be described as follows:

Method definition:

int x =2, y=3; //defining integer variable

int mathMethod (int x)  //method definition

{//method body

int z=x+y; //calculate value

return z;  //return value

}

In the given question option a, b, d, f, and j  is legal, because these options follow the correct syntax, and other option were incorrect which can be defined as follows:

  • In option c, It is illegal because it accepts only one parameter.
  • In option e, It is accepts long number, that's why it is illegal.
  • In option g, It accepts float value, that's why it is illegal.
  • In option h, It doesn't accepts any parameter.
  • In option i, It isn't use in method.
You might be interested in
Write a class Example() such that it has a method that gives the difference between the size of strings when the '-' (subtractio
Mariulka [41]

Answer:

class Example:

def __init__(self, val):

self.val = val

def __gt__(self, other):

return self.val > other.val

def __sub__(self,other):

return abs(len(self.val) - len(other.val))

def main():

obj1 = Example('this is a string')

obj2 = Example('this is another one')

print(obj1 > obj2)

print(obj1 - obj2)

main()

\color{red}\underline{Output:}

3 0
3 years ago
anyone got a class named computer literacy? or sum similar to using Microsoft programs? i need a lotttt of help, im 3 units behi
seropon [69]

Answer:

I use google docs

Explanation:

I am in 6th grade but i am in expert in computers.

6 0
3 years ago
Read 2 more answers
Care and feeding for computer
o-na [289]
Don’t drop it and charge it regularly
5 0
3 years ago
Maxwell says three things Level Two Leaders do well are:
IRINA_888 [86]

Answer:

true

Explanation:

3 0
3 years ago
You can access various sites on WWW by using hyperlinks or by?
wlad13 [49]
You can access various sites on WWW by using hyperlinks or by?

Answer is: A following directions on-screen
5 0
3 years ago
Read 2 more answers
Other questions:
  • What is PHP language
    12·1 answer
  • Write a loop that reads positive integers from standard input and that terminates when it reads an integer that is not positive.
    10·1 answer
  • To use a stored address, C provides us with an indirection operator, ____.
    6·1 answer
  • Discuss the pros and cons of tombstoning versus multitasking. Why do you think Microsoft chose tombstoning?
    11·1 answer
  • The chief intellectual property officer (CIPO) is responsible for collecting, maintaining, and distributing the organization's k
    14·1 answer
  • What is your favorite song? mine is "In the final"
    7·2 answers
  • We can find out how robots work by looking in detail at the smaller parts. What do we call this?
    6·1 answer
  • The use of technology to observe a user's actions often without the user's knowledge is known as:
    11·1 answer
  • At a commercial quick charge station, a fully depleted 87 kwh battery in 2023 ariya can be charged from 20% to 80% in about ____
    10·1 answer
  • the application you attempted to authenticate to is not authorized to use cas. contact your cas administrator to learn how you m
    10·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!