By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
455,806 Members | 1,361 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 455,806 IT Pros & Developers. It's quick & easy.

how many argument received by each method,return type and return value?

P: 4
Expand|Select|Wrap|Line Numbers
  1. public double myMethod (int k){
  2.       int m;
  3.       if (k>0)
  4.             m= -k * 2;
  5.       else
  6.             m= k * 2;
  7.       return m;
  8. }

I just want to know how many arguements received by each method,return type and return value?
Feb 22 '12 #1
Share this Question
Share on Google+
6 Replies

P: 13,264
What do you think are the answers?
Feb 22 '12 #2

P: 4
i did not have any idea!
Feb 22 '12 #3

P: 13,264
You'll have to get an introductory tutorial and read it before starting the assignment then. Have you read any tutorials?
Feb 22 '12 #4

P: 4
ya i read it.but i still not understand about this question!
Feb 23 '12 #5

P: 21
your method is recieving one int argument and return type is double. you need to return a double value for this methods.Anyways prog will work fine becuase of implicit type casting.
but if your method return type is int and you are returning a double value then you will get an error.

found: double
required: int

I think you need to go through method declaration concepts.
search in google you will find so many documents related it.
Feb 24 '12 #6

P: 1

I think you are asking about method profiling. In Method profiling, we can get what is the method name ,argument type, return type, time taken to execute a method etc.

Lot of profilers are available as a free . U can try any one of the tools
- Ramesh
Feb 27 '12 #7

Post your reply

Sign in to post your reply or Sign up for a free account.