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

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • shalini shalu
    Banned
    New Member
    • Feb 2012
    • 4

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

    Code:
    public double myMethod (int k){
          int m;
          if (k>0)
                m= -k * 2;
          else
                m= k * 2;
          return m;
    }

    I just want to know how many arguements received by each method,return type and return value?
    Last edited by Rabbit; Feb 22 '12, 04:27 PM. Reason: Please use code tags when posting code.
  • r035198x
    MVP
    • Sep 2006
    • 13225

    #2
    What do you think are the answers?

    Comment

    • shalini shalu
      Banned
      New Member
      • Feb 2012
      • 4

      #3
      i did not have any idea!

      Comment

      • r035198x
        MVP
        • Sep 2006
        • 13225

        #4
        You'll have to get an introductory tutorial and read it before starting the assignment then. Have you read any tutorials?

        Comment

        • shalini shalu
          Banned
          New Member
          • Feb 2012
          • 4

          #5
          ya i read it.but i still not understand about this question!

          Comment

          • neeraj0708
            New Member
            • Feb 2012
            • 21

            #6
            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.
            like

            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.

            Comment

            • ramsubi
              New Member
              • Feb 2012
              • 1

              #7
              Hai,

              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

              Comment

              Working...