163k views
0 votes
Write the code for invoking a method named sendVariable. There is one int argument for this method. Assume that an int variable called x has already been declared and initialized to some value. Use this variable's value as an argument in your method invocation. Assume that sendVariable is defined in the same class that calls it.

1 Answer

5 votes

Answer:

The code to this question is "sendVariable(x);".

Explanation:

The explanation of the (method calling) code can be given as:

  • In the question, it is defined that there is a method that name is "sendVariable()". In this method, we pass an integer variable that is "x".
  • The variable x value is already declared and assigned and this variable is passed in the method.
  • This method is defined in the same class so the code for calling this method is "sendVariable(x);".
User Rvazquezglez
by
5.5k points