Notices
Results 1 to 3 of 3

Thread: Java question

  1. #1 Java question 
    Forum Freshman
    Join Date
    Jan 2009
    Location
    London
    Posts
    19
    Hello there,
    can anyone help me with this question?
    i'm new in java and need a nice help!


    Consider the following method:

    public static void calculator(int i, int j)
    {

    System.out.println(i + "+" + j + "=" + (i+j));

    }

    Write the instruction for invoking method
    calculator() with values 7 and 12.


    Reply With Quote  
     

  2.  
     

  3. #2  
    WYSIWYG Moderator marnixR's Avatar
    Join Date
    Apr 2007
    Location
    Cardiff, Wales
    Posts
    5,810
    surely that would be something like :

    int result = calculator(7,12);


    "Reality is that which, when you stop believing in it, doesn't go away." (Philip K. Dick)
    Reply With Quote  
     

  4. #3 hi there 
    Forum Freshman
    Join Date
    Jan 2009
    Location
    London
    Posts
    19
    Thank u for this, and i might have more questions in near future,
    just started with java and looks very new to me.

    Antonio
    Reply With Quote  
     

Bookmarks
Bookmarks
Posting Permissions
  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •