SHARE
SPREAD
HELP

The Tradition of Sharing

Help your friends and juniors by posting answers to the questions that you know. Also post questions that are not available.


To start with, Sr2Jr’s first step is to reduce the expenses related to education. To achieve this goal Sr2Jr organized the textbook’s question and answers. Sr2Jr is community based and need your support to fill the question and answers. The question and answers posted will be available free of cost to all.

 

#
Authors:
Barbara Dolye
Chapter:
Methods And Behaviors
Exercise:
Exercises
Question:18 | ISBN:9781285096261 | Edition: 4

Question

Given the following task, which would be the most appropriate method heading?
A method displays three integer values formatted with currency.
a. public static int int int DisplayValues( )
b. public static int DisplayValues(int v1, int v2, int v3)
c. public static void DisplayValues( )
d. public static void DisplayValues(int v1:C, int v2:C,
int v3:C)
e. public static void DisplayValues(int v1, int v2, int v3)

TextbookTextbookTextbookTextbookTextbookTextbookTextbookTextbookTextbookTextbookTextbookTextbookTextbookTextbookTextbookTextbookTextbook

Answer

The correct answer is e. public static void DisplayValues(int v1, int v2, int v3)

Explanation:

  • The method name 'DisplayValues' accepts three integer paramter values, v1,v2, and v3 and return type is 'void'.
  • This method is used to displays three integer values formatted with currency.

So, the correct option is (e).

0 0

Discussions

Post the discussion to improve the above solution.